From 76fac5fb527085f55e1403c31b8555eb3bd31592 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 27 Nov 2023 16:53:28 +0100 Subject: [PATCH] fix(calls): Remove a query in a loop when ending call for everyone Signed-off-by: Joas Schilling --- lib/Listener/RestrictStartingCalls.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/Listener/RestrictStartingCalls.php b/lib/Listener/RestrictStartingCalls.php index f88ab25813e..80d13d89695 100644 --- a/lib/Listener/RestrictStartingCalls.php +++ b/lib/Listener/RestrictStartingCalls.php @@ -28,6 +28,7 @@ use OCA\Talk\Events\AParticipantModifiedEvent; use OCA\Talk\Events\BeforeParticipantModifiedEvent; use OCA\Talk\Exceptions\ForbiddenException; +use OCA\Talk\Participant; use OCA\Talk\Room; use OCA\Talk\Service\ParticipantService; use OCP\EventDispatcher\Event; @@ -57,6 +58,11 @@ public function handle(Event $event): void { return; } + if ($event->getNewValue() === Participant::FLAG_DISCONNECTED + || $event->getOldValue() !== Participant::FLAG_DISCONNECTED) { + return; + } + $room = $event->getRoom(); if ($room->getType() === Room::TYPE_PUBLIC && $room->getObjectType() === Room::OBJECT_TYPE_VIDEO_VERIFICATION) {