diff options
author | Carl Schwan <carl@carlschwan.eu> | 2022-04-05 18:28:52 +0200 |
---|---|---|
committer | Carl Schwan <carl@carlschwan.eu> | 2022-04-05 19:28:06 +0200 |
commit | ddc739b5ac2bb5f54fdb47db6a3e0dfe83d1c473 (patch) | |
tree | f54f75fe1b0d1f58c503e907e1f083889d951e6a /lib/private/TemplateLayout.php | |
parent | 9c84aa5870204a871024ca18b4994ed40defdd9b (diff) | |
download | nextcloud-server-ddc739b5ac2bb5f54fdb47db6a3e0dfe83d1c473.tar.gz nextcloud-server-ddc739b5ac2bb5f54fdb47db6a3e0dfe83d1c473.zip |
Retrieve user status only once when displaying page
We don't need to inject it in the template if the data is already
available in the initial state. This is also a bit cleaner.
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Diffstat (limited to 'lib/private/TemplateLayout.php')
-rw-r--r-- | lib/private/TemplateLayout.php | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/lib/private/TemplateLayout.php b/lib/private/TemplateLayout.php index cf06f021590..6d90d46ec67 100644 --- a/lib/private/TemplateLayout.php +++ b/lib/private/TemplateLayout.php @@ -47,7 +47,6 @@ use OC\Search\SearchQuery; use OC\Template\JSCombiner; use OC\Template\JSConfigHelper; use OC\Template\SCSSCacher; -use OCP\App\IAppManager; use OCP\AppFramework\Http\TemplateResponse; use OCP\Defaults; use OCP\IConfig; @@ -55,7 +54,6 @@ use OCP\IInitialStateService; use OCP\INavigationManager; use OCP\IUserSession; use OCP\Support\Subscription\IRegistry; -use OCP\UserStatus\IManager as IUserStatusManager; use OCP\Util; use Psr\Log\LoggerInterface; @@ -140,17 +138,6 @@ class TemplateLayout extends \OC_Template { } else { $this->assign('userAvatarSet', true); $this->assign('userAvatarVersion', $this->config->getUserValue(\OC_User::getUser(), 'avatar', 'version', 0)); - if (\OC::$server->get(IAppManager::class)->isEnabledForUser('user_status')) { - $userStatusManager = \OC::$server->get(IUserStatusManager::class); - $userStatuses = $userStatusManager->getUserStatuses([$user->getUID()]); - if (array_key_exists($user->getUID(), $userStatuses)) { - $this->assign('userStatus', $userStatuses[$user->getUID()]); - } else { - $this->assign('userStatus', false); - } - } else { - $this->assign('userStatus', false); - } } // check if app menu icons should be inverted |