Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ba48c799 authored by AVINASH GUSAIN's avatar AVINASH GUSAIN Committed by Arnau Vàzquez
Browse files

error quota fix

parent de7205bc
Loading
Loading
Loading
Loading
Loading
+9 −9
Original line number Diff line number Diff line
--- ./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;
+		$free = max(0,$free - $mailQuotaUsage);
+		if($path === '/') {
+				$used = $used + $mailQuotaUsage;
+		}