Skip to content

Commit

Permalink
fix(federation): Allow federation sync to always toggle recording con…
Browse files Browse the repository at this point in the history
…sent

Signed-off-by: Joas Schilling <coding@schilljs.com>
  • Loading branch information
nickvergessen committed Nov 22, 2024
1 parent 37c61aa commit ad5f9a5
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions lib/Service/RoomService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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);
Expand Down

0 comments on commit ad5f9a5

Please sign in to comment.