diff options
author | Joas Schilling <coding@schilljs.com> | 2021-09-20 17:27:20 +0300 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2021-11-03 15:10:34 +0300 |
commit | 56d466029506be73782490ed779fe402c7b39c8f (patch) | |
tree | bceec7edc1c36ea0efcf5b1f8933a54a1a0511dc /lib/Service | |
parent | cb2f6e2c18eee8263b3d939d776ea63a9f3504a8 (diff) |
Log dedicated call summary when ending for everyone
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/Service')
-rw-r--r-- | lib/Service/ParticipantService.php | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/Service/ParticipantService.php b/lib/Service/ParticipantService.php index 1d83fd3c2..c9f05f32e 100644 --- a/lib/Service/ParticipantService.php +++ b/lib/Service/ParticipantService.php @@ -33,6 +33,7 @@ use OCA\Talk\Events\AttendeesRemovedEvent; use OCA\Talk\Events\JoinRoomGuestEvent; use OCA\Talk\Events\JoinRoomUserEvent; 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; @@ -906,6 +907,20 @@ class ParticipantService { $this->dispatcher->dispatch(Room::EVENT_AFTER_GUESTS_CLEAN, $event); } + public function endCallForEveryone(Room $room, Participant $moderator): void { + $event = new ModifyRoomEvent($room, 'in_call', Participant::FLAG_DISCONNECTED, null, $moderator); + $this->dispatcher->dispatch(Room::EVENT_BEFORE_END_CALL_FOR_EVERYONE, $event); + + $participants = $this->getParticipantsInCall($room); + + // kick out all participants out of the call + foreach ($participants as $participant) { + $this->changeInCall($room, $participant, Participant::FLAG_DISCONNECTED); + } + + $this->dispatcher->dispatch(Room::EVENT_AFTER_END_CALL_FOR_EVERYONE, $event); + } + public function changeInCall(Room $room, Participant $participant, int $flags): void { $session = $participant->getSession(); if (!$session instanceof Session) { |