diff --git a/lib/Controller/RoomController.php b/lib/Controller/RoomController.php index ba1ee4b1ae2..e45a1a3da19 100644 --- a/lib/Controller/RoomController.php +++ b/lib/Controller/RoomController.php @@ -1505,6 +1505,15 @@ public function setReadOnly(int $state): DataResponse { return new DataResponse([], Http::STATUS_BAD_REQUEST); } + if ($state === Room::READ_ONLY) { + $participants = $this->participantService->getParticipantsInCall($this->room); + + // kick out all participants out of the call + foreach ($participants as $participant) { + $this->participantService->changeInCall($this->room, $participant, Participant::FLAG_DISCONNECTED); + } + } + return new DataResponse(); } diff --git a/lib/Service/ParticipantService.php b/lib/Service/ParticipantService.php index 4ad4206d643..d971535822f 100644 --- a/lib/Service/ParticipantService.php +++ b/lib/Service/ParticipantService.php @@ -474,6 +474,10 @@ public function changeInCall(Room $room, Participant $participant, int $flags): return; } + if ($session->getInCall() === $flags) { + return; + } + $event = new ModifyParticipantEvent($room, $participant, 'inCall', $flags, $session->getInCall()); if ($flags !== Participant::FLAG_DISCONNECTED) { $this->dispatcher->dispatch(Room::EVENT_BEFORE_SESSION_JOIN_CALL, $event); diff --git a/src/components/ConversationSettings/LobbySettings.vue b/src/components/ConversationSettings/LobbySettings.vue index c7300838098..7bfced8ff9d 100644 --- a/src/components/ConversationSettings/LobbySettings.vue +++ b/src/components/ConversationSettings/LobbySettings.vue @@ -25,6 +25,9 @@