diff --git a/lib/Service/RoomService.php b/lib/Service/RoomService.php index a813e906596..bba48b4a67d 100644 --- a/lib/Service/RoomService.php +++ b/lib/Service/RoomService.php @@ -291,7 +291,7 @@ public function setSIPEnabled(Room $room, int $newSipEnabled): void { * @psalm-param RecordingService::CONSENT_REQUIRED_* $recordingConsent * @throws RecordingConsentException When the room has an active call or the value is invalid */ - public function setRecordingConsent(Room $room, int $recordingConsent, bool $allowUpdatingBreakoutRooms = false): void { + public function setRecordingConsent(Room $room, int $recordingConsent, bool $allowUpdatingBreakoutRoomsAndFederatedRooms = false): void { $oldRecordingConsent = $room->getRecordingConsent(); if ($recordingConsent === $oldRecordingConsent) { @@ -302,16 +302,18 @@ public function setRecordingConsent(Room $room, int $recordingConsent, bool $all throw new RecordingConsentException(RecordingConsentException::REASON_VALUE); } - if ($recordingConsent !== RecordingService::CONSENT_REQUIRED_NO && $room->getCallFlag() !== Participant::FLAG_DISCONNECTED) { - throw new RecordingConsentException(RecordingConsentException::REASON_CALL); - } + if (!$allowUpdatingBreakoutRoomsAndFederatedRooms) { + if ($recordingConsent !== RecordingService::CONSENT_REQUIRED_NO && $room->getCallFlag() !== Participant::FLAG_DISCONNECTED) { + throw new RecordingConsentException(RecordingConsentException::REASON_CALL); + } - if (!$allowUpdatingBreakoutRooms && $room->getObjectType() === BreakoutRoom::PARENT_OBJECT_TYPE) { - throw new RecordingConsentException(RecordingConsentException::REASON_BREAKOUT_ROOM); - } + if ($room->getObjectType() === BreakoutRoom::PARENT_OBJECT_TYPE) { + throw new RecordingConsentException(RecordingConsentException::REASON_BREAKOUT_ROOM); + } - if ($room->getBreakoutRoomStatus() !== BreakoutRoom::STATUS_STOPPED) { - throw new RecordingConsentException(RecordingConsentException::REASON_BREAKOUT_ROOM); + if ($room->getBreakoutRoomStatus() !== BreakoutRoom::STATUS_STOPPED) { + throw new RecordingConsentException(RecordingConsentException::REASON_BREAKOUT_ROOM); + } } $event = new BeforeRoomModifiedEvent($room, ARoomModifiedEvent::PROPERTY_RECORDING_CONSENT, $recordingConsent, $oldRecordingConsent);