]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix missing status with predefined status in drop-down
authorJoas Schilling <coding@schilljs.com>
Fri, 27 May 2022 07:15:15 +0000 (09:15 +0200)
committerbackportbot-nextcloud[bot] <backportbot-nextcloud[bot]@users.noreply.github.com>
Fri, 27 May 2022 09:23:54 +0000 (09:23 +0000)
When a predefined status message was used, the status was not "processed"
so it was missing the translated message and the icon in the dropdown and the menu afterwards

Signed-off-by: Joas Schilling <coding@schilljs.com>
apps/user_status/lib/Listener/UserLiveStatusListener.php

index c015e6841420ac708c414fbfe94a639c609b01d1..3e05efa7118616a80e8673989fc089590117c3ab 100644 (file)
@@ -43,11 +43,14 @@ use OCP\UserStatus\IUserStatus;
  */
 class UserLiveStatusListener implements IEventListener {
        private UserStatusMapper $mapper;
+       private StatusService $statusService;
        private ITimeFactory $timeFactory;
 
        public function __construct(UserStatusMapper $mapper,
+                                                               StatusService $statusService,
                                                                ITimeFactory $timeFactory) {
                $this->mapper = $mapper;
+               $this->statusService = $statusService;
                $this->timeFactory = $timeFactory;
        }
 
@@ -62,7 +65,7 @@ class UserLiveStatusListener implements IEventListener {
 
                $user = $event->getUser();
                try {
-                       $userStatus = $this->mapper->findByUserId($user->getUID());
+                       $userStatus = $this->statusService->findByUserId($user->getUID());
                } catch (DoesNotExistException $ex) {
                        $userStatus = new UserStatus();
                        $userStatus->setUserId($user->getUID());