Fix missing status with predefined status in drop-down

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>
This commit is contained in:
Joas Schilling 2022-05-27 09:15:15 +02:00 committed by John Molakvoæ
parent cb2b8dec85
commit 22ad2fe918
No known key found for this signature in database
GPG key ID: 60C25B8C072916CF

View 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());