diff --git a/patches/014-add-mail-usage.patch b/patches/014-add-mail-usage.patch index d9cf77aa9731d2dac1659ab181969da7e090d7f6..02836ee9aa0e879a225b3e26ce3048717d8a104f 100644 --- a/patches/014-add-mail-usage.patch +++ b/patches/014-add-mail-usage.patch @@ -1,22 +1,22 @@ ---- ./lib/private/legacy/OC_Helper.php 2022-03-28 17:42:25.107644314 +0530 -+++ ./lib/private/legacy/OC_Helper-new.php 2022-03-28 17:44:07.349596051 +0530 +--- lib/private/legacy/OC_Helper.php 2022-05-17 19:34:56.340385500 +0530 ++++ lib/private/legacy/OC_Helper_new.php 2022-05-17 21:19:30.060385500 +0530 @@ -532,6 +532,12 @@ $quota = $sourceStorage->getQuota(); } $free = $sourceStorage->free_space($internalPath); -+ $ownerId = $storage->getOwner($path); -+ $mailQuotaUsage = (int) \OC::$server->getConfig()->getUserValue($ownerId, 'ecloud-accounts', 'mailQuotaUsage', 0); -+ $free = $free - $mailQuotaUsage; -+ if($path === '/') { -+ $used = $used + $mailQuotaUsage; -+ } ++ $ownerId = $storage->getOwner($path); ++ $mailQuotaUsage = (int) \OC::$server->getConfig()->getUserValue($ownerId, 'ecloud-accounts', 'mailQuotaUsage', 0); ++ $free = max(0,$free - $mailQuotaUsage); ++ if($path === '/') { ++ $used = $used + $mailQuotaUsage; ++ } if ($free >= 0) { $total = $free + $used; } else { @@ -547,7 +553,6 @@ $relative = 0; } - + - $ownerId = $storage->getOwner($path); $ownerDisplayName = ''; $owner = \OC::$server->getUserManager()->get($ownerId);