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 /core/templates | |
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 'core/templates')
-rw-r--r-- | core/templates/layout.user.php | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/core/templates/layout.user.php b/core/templates/layout.user.php index ce316b882e6..2b84c89fca6 100644 --- a/core/templates/layout.user.php +++ b/core/templates/layout.user.php @@ -153,11 +153,7 @@ $getUserAvatar = static function (int $size) use ($_): string { } ?>" data-user="<?php p($_['user_uid']); ?>" data-displayname="<?php p($_['user_displayname']); ?>" - <?php if ($_['userStatus'] !== false) { ?> - data-userstatus="<?php p($_['userStatus']->getStatus()); ?>" - data-userstatus_message="<?php p($_['userStatus']->getMessage()); ?>" - data-userstatus_icon="<?php p($_['userStatus']->getIcon()); ?>" - <?php } + <?php if ($_['userAvatarSet']) { $avatar32 = $getUserAvatar(32); ?> data-avatar="<?php p($avatar32); ?>" <?php |