]> 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)
committerJoas Schilling <coding@schilljs.com>
Fri, 27 May 2022 10:18:09 +0000 (12:18 +0200)
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 60b5fb7f3a46505751f3602603399d691467e0ea..8203069e78f54f8a597ba76d23b622adbc5d4216 100644 (file)
@@ -45,18 +45,17 @@ class UserLiveStatusListener implements IEventListener {
        /** @var UserStatusMapper */
        private $mapper;
 
+       /** @var StatusService */
+       private $statusService;
+
        /** @var ITimeFactory */
        private $timeFactory;
 
-       /**
-        * UserLiveStatusListener constructor.
-        *
-        * @param UserStatusMapper $mapper
-        * @param ITimeFactory $timeFactory
-        */
        public function __construct(UserStatusMapper $mapper,
+                                                               StatusService $statusService,
                                                                ITimeFactory $timeFactory) {
                $this->mapper = $mapper;
+               $this->statusService = $statusService;
                $this->timeFactory = $timeFactory;
        }
 
@@ -71,7 +70,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());