aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private')
-rw-r--r--lib/private/User/User.php8
-rw-r--r--lib/private/legacy/OC_Helper.php6
2 files changed, 12 insertions, 2 deletions
diff --git a/lib/private/User/User.php b/lib/private/User/User.php
index 88ed0d44387..e1b6308b141 100644
--- a/lib/private/User/User.php
+++ b/lib/private/User/User.php
@@ -14,6 +14,7 @@ use OC\Hooks\Emitter;
use OCP\Accounts\IAccountManager;
use OCP\Comments\ICommentsManager;
use OCP\EventDispatcher\IEventDispatcher;
+use OCP\Files\IRootFolder;
use OCP\Group\Events\BeforeUserRemovedEvent;
use OCP\Group\Events\UserRemovedEvent;
use OCP\IAvatarManager;
@@ -25,6 +26,7 @@ use OCP\IURLGenerator;
use OCP\IUser;
use OCP\IUserBackend;
use OCP\Notification\IManager as INotificationManager;
+use OCP\Server;
use OCP\User\Backend\IGetHomeBackend;
use OCP\User\Backend\IPasswordHashBackend;
use OCP\User\Backend\IProvideAvatarBackend;
@@ -592,7 +594,11 @@ class User implements IUser {
$this->config->setUserValue($this->uid, 'files', 'quota', $quota);
$this->triggerChange('quota', $quota, $oldQuota);
}
- \OC_Helper::clearStorageInfo('/' . $this->uid . '/files');
+
+ // clear the quota cache
+ $root = Server::get(IRootFolder::class);
+ $userFolder = $root->getUserFolder($this->uid);
+ $userFolder->getUserQuota(false);
}
public function getManagerUids(): array {
diff --git a/lib/private/legacy/OC_Helper.php b/lib/private/legacy/OC_Helper.php
index 4388f775623..2d12e2df510 100644
--- a/lib/private/legacy/OC_Helper.php
+++ b/lib/private/legacy/OC_Helper.php
@@ -219,6 +219,7 @@ class OC_Helper {
* @psalm-suppress LessSpecificReturnStatement Legacy code outputs weird types - manually validated that they are correct
* @return StorageInfo
* @throws \OCP\Files\NotFoundException
+ * @deprecated 32.0.0 use \OCP\Files\IUserFolder::getUserQuota
*/
public static function getStorageInfo($path, $rootInfo = null, $includeMountPoints = true, $useCache = true) {
if (!self::$cacheFactory) {
@@ -281,7 +282,7 @@ class OC_Helper {
// TODO: need a better way to get total space from storage
if ($sourceStorage->instanceOfStorage('\OC\Files\Storage\Wrapper\Quota')) {
- /** @var \OC\Files\Storage\Wrapper\Quota $storage */
+ /** @var \OC\Files\Storage\Wrapper\Quota $sourceStorage */
$quota = $sourceStorage->getQuota();
}
try {
@@ -403,6 +404,9 @@ class OC_Helper {
];
}
+ /**
+ * @deprecated 32.0.0
+ */
public static function clearStorageInfo(string $absolutePath): void {
/** @var ICacheFactory $cacheFactory */
$cacheFactory = \OC::$server->get(ICacheFactory::class);