Browse Source

feat(userstatus): use busy status for calls

Signed-off-by: Anna Larch <anna@nextcloud.com>
pull/15484/head
Anna Larch 4 months ago
parent
commit
4773851fd3
  1. 6
      lib/Status/Listener.php
  2. 3
      tests/integration/features/chat-1/one-to-one.feature

6
lib/Status/Listener.php

@ -62,7 +62,7 @@ class Listener implements IEventListener {
protected function setUserStatus(BeforeParticipantModifiedEvent $event): void {
$status = IUserStatus::AWAY;
$status = IUserStatus::BUSY;
$userId = $event->getParticipant()->getAttendee()->getActorId();
@ -90,13 +90,13 @@ class Listener implements IEventListener {
}
protected function revertUserStatusOnLeaveCall(BeforeParticipantModifiedEvent $event): void {
$this->statusManager->revertUserStatus($event->getParticipant()->getAttendee()->getActorId(), 'call', IUserStatus::AWAY);
$this->statusManager->revertUserStatus($event->getParticipant()->getAttendee()->getActorId(), 'call', IUserStatus::BUSY);
}
protected function revertUserStatusOnEndCallForEveryone(CallEndedForEveryoneEvent $event): void {
$userIds = $event->getUserIds();
if (!empty($userIds)) {
$this->statusManager->revertMultipleUserStatus($userIds, 'call', IUserStatus::AWAY);
$this->statusManager->revertMultipleUserStatus($userIds, 'call', IUserStatus::BUSY);
}
}
}

3
tests/integration/features/chat-1/one-to-one.feature

@ -87,3 +87,6 @@ Feature: chat/one-to-one
Then user "participant2" set status to "away" with 200 (v1)
Then user "participant1" gets room "one-to-one room" with 200 (v4)
| status | away |
Then user "participant2" set status to "busy" with 200 (v1)
Then user "participant1" gets room "one-to-one room" with 200 (v4)
| status | busy |
Loading…
Cancel
Save