Skip to content

Commit

Permalink
fix(calls): Remove a query in a loop when ending call for everyone
Browse files Browse the repository at this point in the history
Signed-off-by: Joas Schilling <coding@schilljs.com>
  • Loading branch information
nickvergessen committed Nov 27, 2023
1 parent 1fecac7 commit 76fac5f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/Listener/RestrictStartingCalls.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 76fac5f

Please sign in to comment.