Loading patches/014-add-mail-usage.patch +2 −1 Original line number Diff line number Diff line Loading @@ -24,13 +24,14 @@ if ($owner) { --- lib/private/Files/Storage/Wrapper/Quota.php 2024-02-28 23:45:03.136041704 +0530 +++ lib/private/Files/Storage/Wrapper/Quota-new.php 2024-02-28 23:49:24.518192286 +0530 @@ -117,7 +117,9 @@ @@ -117,7 +117,10 @@ return FileInfo::SPACE_NOT_COMPUTED; } else { $free = $this->storage->free_space($path); - $quotaFree = max($this->getQuota() - $used, 0); + $ownerId = $this->storage->getUser()->getUID(); + $mailQuotaUsage = (int) \OC::$server->getConfig()->getUserValue($ownerId, 'ecloud-accounts', 'mailQuotaUsage', 0); + $mailQuotaUsage = max($mailQuotaUsage, 0); // to avoid negative mail quota usage value + $quotaFree = max($this->getQuota() - $used - $mailQuotaUsage, 0); // if free space is known $free = $free >= 0 ? min($free, $quotaFree) : $quotaFree; Loading Loading
patches/014-add-mail-usage.patch +2 −1 Original line number Diff line number Diff line Loading @@ -24,13 +24,14 @@ if ($owner) { --- lib/private/Files/Storage/Wrapper/Quota.php 2024-02-28 23:45:03.136041704 +0530 +++ lib/private/Files/Storage/Wrapper/Quota-new.php 2024-02-28 23:49:24.518192286 +0530 @@ -117,7 +117,9 @@ @@ -117,7 +117,10 @@ return FileInfo::SPACE_NOT_COMPUTED; } else { $free = $this->storage->free_space($path); - $quotaFree = max($this->getQuota() - $used, 0); + $ownerId = $this->storage->getUser()->getUID(); + $mailQuotaUsage = (int) \OC::$server->getConfig()->getUserValue($ownerId, 'ecloud-accounts', 'mailQuotaUsage', 0); + $mailQuotaUsage = max($mailQuotaUsage, 0); // to avoid negative mail quota usage value + $quotaFree = max($this->getQuota() - $used - $mailQuotaUsage, 0); // if free space is known $free = $free >= 0 ? min($free, $quotaFree) : $quotaFree; Loading