diff options
author | Joas Schilling <coding@schilljs.com> | 2022-01-26 11:20:44 +0300 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2022-01-26 12:18:23 +0300 |
commit | 3ba29c0478eaa54d90d12175e0620ec041827025 (patch) | |
tree | 1ecfcbdcf1e89eee8b331b5f9b521abc39f1e009 /lib/Service | |
parent | 0abdf03ba06a1d6e5878d44c772343a5c8d1adf0 (diff) |
Only send 1 HPB request for the "end call for everyone" case
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/Service')
-rw-r--r-- | lib/Service/ParticipantService.php | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/Service/ParticipantService.php b/lib/Service/ParticipantService.php index d11bf996e..2bd4010fd 100644 --- a/lib/Service/ParticipantService.php +++ b/lib/Service/ParticipantService.php @@ -30,11 +30,11 @@ use OCA\Talk\Config; use OCA\Talk\Events\AddParticipantsEvent; use OCA\Talk\Events\AttendeesAddedEvent; use OCA\Talk\Events\AttendeesRemovedEvent; +use OCA\Talk\Events\EndCallForEveryoneEvent; use OCA\Talk\Events\JoinRoomGuestEvent; use OCA\Talk\Events\JoinRoomUserEvent; use OCA\Talk\Events\ModifyEveryoneEvent; use OCA\Talk\Events\ModifyParticipantEvent; -use OCA\Talk\Events\ModifyRoomEvent; use OCA\Talk\Events\ParticipantEvent; use OCA\Talk\Events\RemoveParticipantEvent; use OCA\Talk\Events\RemoveUserEvent; @@ -908,16 +908,20 @@ class ParticipantService { } public function endCallForEveryone(Room $room, Participant $moderator): void { - $event = new ModifyRoomEvent($room, 'in_call', Participant::FLAG_DISCONNECTED, null, $moderator); + $event = new EndCallForEveryoneEvent($room, $moderator); $this->dispatcher->dispatch(Room::EVENT_BEFORE_END_CALL_FOR_EVERYONE, $event); $participants = $this->getParticipantsInCall($room); + $changedSessionIds = []; // kick out all participants out of the call foreach ($participants as $participant) { + $changedSessionIds[] = $participant->getSession()->getSessionId(); $this->changeInCall($room, $participant, Participant::FLAG_DISCONNECTED, true); } + $event->setSessionIds($changedSessionIds); + $this->dispatcher->dispatch(Room::EVENT_AFTER_END_CALL_FOR_EVERYONE, $event); } |