From be5b9e36cd533a25029f623a185a4ba84506aad5 Mon Sep 17 00:00:00 2001 From: Christopher Ng Date: Tue, 23 Nov 2021 22:58:44 +0000 Subject: Hide user status from public Signed-off-by: Christopher Ng --- core/Controller/ProfilePageController.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'core/Controller/ProfilePageController.php') diff --git a/core/Controller/ProfilePageController.php b/core/Controller/ProfilePageController.php index e4064370d9c..505dfa4e249 100644 --- a/core/Controller/ProfilePageController.php +++ b/core/Controller/ProfilePageController.php @@ -127,13 +127,15 @@ class ProfilePageController extends Controller { } } - $userStatuses = $this->userStatusManager->getUserStatuses([$targetUserId]); - $status = $userStatuses[$targetUserId] ?? null; - if ($status !== null) { - $this->initialStateService->provideInitialState('status', [ - 'icon' => $status->getIcon(), - 'message' => $status->getMessage(), - ]); + if ($visitingUser !== null) { + $userStatuses = $this->userStatusManager->getUserStatuses([$targetUserId]); + $status = $userStatuses[$targetUserId] ?? null; + if ($status !== null) { + $this->initialStateService->provideInitialState('status', [ + 'icon' => $status->getIcon(), + 'message' => $status->getMessage(), + ]); + } } $this->initialStateService->provideInitialState( -- cgit v1.2.3