diff options
author | Joas Schilling <coding@schilljs.com> | 2021-09-20 17:27:40 +0300 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2021-11-03 15:10:34 +0300 |
commit | 9d924ad0146c9de8ae52a7963acf7fccdf70a690 (patch) | |
tree | b6bd5677d8aa9a85f804061000b7da8d8fe9ef93 /lib/Service | |
parent | 56d466029506be73782490ed779fe402c7b39c8f (diff) |
Don't log single "call_left" system messages when call ended for everyone
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/Service')
-rw-r--r-- | lib/Service/ParticipantService.php | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/Service/ParticipantService.php b/lib/Service/ParticipantService.php index c9f05f32e..da15b56ed 100644 --- a/lib/Service/ParticipantService.php +++ b/lib/Service/ParticipantService.php @@ -32,6 +32,7 @@ use OCA\Talk\Events\AttendeesAddedEvent; use OCA\Talk\Events\AttendeesRemovedEvent; 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; @@ -915,13 +916,13 @@ class ParticipantService { // kick out all participants out of the call foreach ($participants as $participant) { - $this->changeInCall($room, $participant, Participant::FLAG_DISCONNECTED); + $this->changeInCall($room, $participant, Participant::FLAG_DISCONNECTED, true); } $this->dispatcher->dispatch(Room::EVENT_AFTER_END_CALL_FOR_EVERYONE, $event); } - public function changeInCall(Room $room, Participant $participant, int $flags): void { + public function changeInCall(Room $room, Participant $participant, int $flags, bool $endCallForEveryone = false): void { $session = $participant->getSession(); if (!$session instanceof Session) { return; @@ -935,10 +936,15 @@ class ParticipantService { $flags &= ~Participant::FLAG_WITH_VIDEO; } - $event = new ModifyParticipantEvent($room, $participant, 'inCall', $flags, $session->getInCall()); if ($flags !== Participant::FLAG_DISCONNECTED) { + $event = new ModifyParticipantEvent($room, $participant, 'inCall', $flags, $session->getInCall()); $this->dispatcher->dispatch(Room::EVENT_BEFORE_SESSION_JOIN_CALL, $event); } else { + if ($endCallForEveryone) { + $event = new ModifyEveryoneEvent($room, $participant, 'inCall', $flags, $session->getInCall()); + } else { + $event = new ModifyParticipantEvent($room, $participant, 'inCall', $flags, $session->getInCall()); + } $this->dispatcher->dispatch(Room::EVENT_BEFORE_SESSION_LEAVE_CALL, $event); } |