From cbc27d3ca7a0c17ca0f95b5618c7b997b02af63f Mon Sep 17 00:00:00 2001 From: provokateurin Date: Fri, 29 Dec 2023 18:11:35 +0100 Subject: feat(user_status): Add online status type for OpenAPI Signed-off-by: provokateurin --- apps/user_status/lib/Controller/UserStatusController.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'apps/user_status/lib/Controller/UserStatusController.php') diff --git a/apps/user_status/lib/Controller/UserStatusController.php b/apps/user_status/lib/Controller/UserStatusController.php index 3beb8abc3ab..053b07664a5 100644 --- a/apps/user_status/lib/Controller/UserStatusController.php +++ b/apps/user_status/lib/Controller/UserStatusController.php @@ -47,6 +47,7 @@ use OCP\IRequest; use Psr\Log\LoggerInterface; /** + * @psalm-import-type UserStatusType from ResponseDefinitions * @psalm-import-type UserStatusPrivate from ResponseDefinitions */ class UserStatusController extends OCSController { @@ -207,6 +208,8 @@ class UserStatusController extends OCSController { * @return UserStatusPrivate */ private function formatStatus(UserStatus $status): array { + /** @var UserStatusType $visibleStatus */ + $visibleStatus = $status->getStatus(); return [ 'userId' => $status->getUserId(), 'message' => $status->getCustomMessage(), @@ -214,7 +217,7 @@ class UserStatusController extends OCSController { 'messageIsPredefined' => $status->getMessageId() !== null, 'icon' => $status->getCustomIcon(), 'clearAt' => $status->getClearAt(), - 'status' => $status->getStatus(), + 'status' => $visibleStatus, 'statusIsUserDefined' => $status->getIsUserDefined(), ]; } -- cgit v1.2.3