diff --git a/patches/014-add-mail-usage.patch b/patches/014-add-mail-usage.patch index 0283a63b5d9f01e5128bdd671114372ced002daa..67109857aa8c38254483a282002909f3291f96e8 100644 --- a/patches/014-add-mail-usage.patch +++ b/patches/014-add-mail-usage.patch @@ -21,18 +21,4 @@ + $ownerDisplayName = ''; $owner = \OC::$server->getUserManager()->get($ownerId); - 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,10 @@ - return FileInfo::SPACE_NOT_COMPUTED; - } else { - $free = $this->storage->free_space($path); -- $quotaFree = max($this->getQuota() - $used, 0); -+ $ownerId = $this->storage->getOwner($path); -+ $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; - return $free; + if ($owner) { \ No newline at end of file