*/
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;
}
$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());