From d7f337086356b2ce39ad52b8e6e74adf872fea4a Mon Sep 17 00:00:00 2001 From: Avinash Gusain Date: Tue, 17 May 2022 20:01:50 +0530 Subject: [PATCH 1/3] error quota fix --- patches/014-add-mail-usage.patch | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/patches/014-add-mail-usage.patch b/patches/014-add-mail-usage.patch index d9cf77aa..0ccf5499 100644 --- a/patches/014-add-mail-usage.patch +++ b/patches/014-add-mail-usage.patch @@ -1,22 +1,23 @@ ---- ./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 -@@ -532,6 +532,12 @@ +--- lib/private/legacy/OC_Helper.php 2022-05-17 19:34:56.340385500 +0530 ++++ lib/private/legacy/OC_Helper_new.php 2022-05-17 19:52:38.260385500 +0530 +@@ -532,6 +532,13 @@ $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 = $free - $mailQuotaUsage; ++ $free = max(0,$free); ++ if($path === '/') { ++ $used = $used + $mailQuotaUsage; ++ } if ($free >= 0) { $total = $free + $used; } else { -@@ -547,7 +553,6 @@ +@@ -547,7 +554,6 @@ $relative = 0; } - + - $ownerId = $storage->getOwner($path); $ownerDisplayName = ''; $owner = \OC::$server->getUserManager()->get($ownerId); -- GitLab From 12b0d1fabe524a2cf99a87f17617d76051df6b6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnau=20V=C3=A0zquez?= Date: Tue, 17 May 2022 15:44:39 +0000 Subject: [PATCH 2/3] Apply 1 suggestion(s) to 1 file(s) --- patches/014-add-mail-usage.patch | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/patches/014-add-mail-usage.patch b/patches/014-add-mail-usage.patch index 0ccf5499..a0ec4da4 100644 --- a/patches/014-add-mail-usage.patch +++ b/patches/014-add-mail-usage.patch @@ -6,8 +6,7 @@ $free = $sourceStorage->free_space($internalPath); + $ownerId = $storage->getOwner($path); + $mailQuotaUsage = (int) \OC::$server->getConfig()->getUserValue($ownerId, 'ecloud-accounts', 'mailQuotaUsage', 0); -+ $free = $free - $mailQuotaUsage; -+ $free = max(0,$free); ++ $free = max(0, $free - $mailQuotaUsage); + if($path === '/') { + $used = $used + $mailQuotaUsage; + } -- GitLab From 452e690148f3d0cb844b9e5de2e91cd43ef020b6 Mon Sep 17 00:00:00 2001 From: Avinash Gusain Date: Tue, 17 May 2022 21:23:21 +0530 Subject: [PATCH 3/3] error quota suggestion added --- patches/014-add-mail-usage.patch | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/patches/014-add-mail-usage.patch b/patches/014-add-mail-usage.patch index 0ccf5499..02836ee9 100644 --- a/patches/014-add-mail-usage.patch +++ b/patches/014-add-mail-usage.patch @@ -1,20 +1,19 @@ --- lib/private/legacy/OC_Helper.php 2022-05-17 19:34:56.340385500 +0530 -+++ lib/private/legacy/OC_Helper_new.php 2022-05-17 19:52:38.260385500 +0530 -@@ -532,6 +532,13 @@ ++++ 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; -+ $free = max(0,$free); ++ $free = max(0,$free - $mailQuotaUsage); + if($path === '/') { + $used = $used + $mailQuotaUsage; + } if ($free >= 0) { $total = $free + $used; } else { -@@ -547,7 +554,6 @@ +@@ -547,7 +553,6 @@ $relative = 0; } -- GitLab