diff --git a/lib/Federation/CloudFederationProviderTalk.php b/lib/Federation/CloudFederationProviderTalk.php index 8fc3a7fd02d..f24a61388c0 100644 --- a/lib/Federation/CloudFederationProviderTalk.php +++ b/lib/Federation/CloudFederationProviderTalk.php @@ -367,6 +367,7 @@ private function roomModified(int $remoteAttendeeId, array $notification): array } elseif ($notification['changedProperty'] === ARoomModifiedEvent::PROPERTY_AVATAR) { $this->roomService->setAvatar($room, $notification['newValue']); } elseif ($notification['changedProperty'] === ARoomModifiedEvent::PROPERTY_CALL_RECORDING) { + /** @psalm-suppress InvalidArgument */ $this->roomService->setCallRecording($room, $notification['newValue']); } elseif ($notification['changedProperty'] === ARoomModifiedEvent::PROPERTY_DEFAULT_PERMISSIONS) { $this->roomService->setDefaultPermissions($room, $notification['newValue']); diff --git a/lib/ResponseDefinitions.php b/lib/ResponseDefinitions.php index 90880bb0e00..529e44ff5b5 100644 --- a/lib/ResponseDefinitions.php +++ b/lib/ResponseDefinitions.php @@ -234,7 +234,7 @@ * breakoutRoomStatus: int, * callFlag: int, * callPermissions: int, - * callRecording: int, + * callRecording: 0|1|2|3|4|5, * callStartTime: int, * canDeleteConversation: bool, * canEnableSIP: bool, @@ -256,7 +256,7 @@ * listable: int, * lobbyState: int, * lobbyTimer: int, - * mentionPermissions: int, + * mentionPermissions: 0|1, * messageExpiration: int, * name: string, * notificationCalls: int, diff --git a/lib/Room.php b/lib/Room.php index 38fac9e6af9..a8a79e038e0 100644 --- a/lib/Room.php +++ b/lib/Room.php @@ -88,9 +88,11 @@ class Room { protected ?Participant $participant = null; /** - * @psalm-param Room::TYPE_* $type + * @psalm-param self::TYPE_* $type * @psalm-param RecordingService::CONSENT_REQUIRED_* $recordingConsent * @psalm-param int-mask-of $hasFederation + * @psalm-param self::RECORDING_* $callRecording + * @psalm-param self::MENTION_PERMISSIONS_* $mentionPermissions */ public function __construct( private Manager $manager, @@ -529,10 +531,16 @@ public function setBreakoutRoomStatus(int $status): void { $this->breakoutRoomStatus = $status; } + /** + * @psalm-return self::RECORDING_* + */ public function getCallRecording(): int { return $this->callRecording; } + /** + * @psalm-param self::RECORDING_* $callRecording + */ public function setCallRecording(int $callRecording): void { $this->callRecording = $callRecording; } @@ -567,10 +575,16 @@ public function setFederatedParticipants(int $hasFederation): void { $this->hasFederation = $hasFederation; } + /** + * @psalm-return self::MENTION_PERMISSIONS_* + */ public function getMentionPermissions(): int { return $this->mentionPermissions; } + /** + * @psalm-param self::MENTION_PERMISSIONS_* $mentionPermissions + */ public function setMentionPermissions(int $mentionPermissions): void { $this->mentionPermissions = $mentionPermissions; } diff --git a/lib/Service/RecordingService.php b/lib/Service/RecordingService.php index c3bb3d5122d..a88888a2dce 100644 --- a/lib/Service/RecordingService.php +++ b/lib/Service/RecordingService.php @@ -84,6 +84,9 @@ public function __construct( ) { } + /** + * @psalm-param Room::RECORDING_* $status + */ public function start(Room $room, int $status, string $owner, Participant $participant): void { $availableRecordingTypes = [Room::RECORDING_VIDEO, Room::RECORDING_AUDIO]; if (!in_array($status, $availableRecordingTypes, true)) { diff --git a/lib/Service/RoomService.php b/lib/Service/RoomService.php index 908ff77d0bd..5605596be80 100644 --- a/lib/Service/RoomService.php +++ b/lib/Service/RoomService.php @@ -462,7 +462,7 @@ public function setAvatar(Room $room, string $avatar): void { /** * @param Room $room - * @param integer $status 0 none|1 video|2 audio + * @psalm-param Room::RECORDING_* $status * @param Participant|null $participant the Participant that changed the * state, null for the current user * @throws CallRecordingException diff --git a/openapi-backend-sipbridge.json b/openapi-backend-sipbridge.json index f078c3cc06c..0fd59bed2ee 100644 --- a/openapi-backend-sipbridge.json +++ b/openapi-backend-sipbridge.json @@ -633,7 +633,15 @@ }, "callRecording": { "type": "integer", - "format": "int64" + "format": "int64", + "enum": [ + 0, + 1, + 2, + 3, + 4, + 5 + ] }, "callStartTime": { "type": "integer", @@ -710,7 +718,11 @@ }, "mentionPermissions": { "type": "integer", - "format": "int64" + "format": "int64", + "enum": [ + 0, + 1 + ] }, "messageExpiration": { "type": "integer", diff --git a/openapi-federation.json b/openapi-federation.json index 1e9b5d4d18b..b50e642c861 100644 --- a/openapi-federation.json +++ b/openapi-federation.json @@ -687,7 +687,15 @@ }, "callRecording": { "type": "integer", - "format": "int64" + "format": "int64", + "enum": [ + 0, + 1, + 2, + 3, + 4, + 5 + ] }, "callStartTime": { "type": "integer", @@ -764,7 +772,11 @@ }, "mentionPermissions": { "type": "integer", - "format": "int64" + "format": "int64", + "enum": [ + 0, + 1 + ] }, "messageExpiration": { "type": "integer", diff --git a/openapi-full.json b/openapi-full.json index 76428dfacc3..0de184c4152 100644 --- a/openapi-full.json +++ b/openapi-full.json @@ -1246,7 +1246,15 @@ }, "callRecording": { "type": "integer", - "format": "int64" + "format": "int64", + "enum": [ + 0, + 1, + 2, + 3, + 4, + 5 + ] }, "callStartTime": { "type": "integer", @@ -1323,7 +1331,11 @@ }, "mentionPermissions": { "type": "integer", - "format": "int64" + "format": "int64", + "enum": [ + 0, + 1 + ] }, "messageExpiration": { "type": "integer", diff --git a/openapi.json b/openapi.json index fcc98304250..bfdd4592def 100644 --- a/openapi.json +++ b/openapi.json @@ -1151,7 +1151,15 @@ }, "callRecording": { "type": "integer", - "format": "int64" + "format": "int64", + "enum": [ + 0, + 1, + 2, + 3, + 4, + 5 + ] }, "callStartTime": { "type": "integer", @@ -1228,7 +1236,11 @@ }, "mentionPermissions": { "type": "integer", - "format": "int64" + "format": "int64", + "enum": [ + 0, + 1 + ] }, "messageExpiration": { "type": "integer", diff --git a/src/types/openapi/openapi-backend-sipbridge.ts b/src/types/openapi/openapi-backend-sipbridge.ts index ce2b5875e90..30131ce6a9a 100644 --- a/src/types/openapi/openapi-backend-sipbridge.ts +++ b/src/types/openapi/openapi-backend-sipbridge.ts @@ -275,8 +275,11 @@ export type components = { callFlag: number; /** Format: int64 */ callPermissions: number; - /** Format: int64 */ - callRecording: number; + /** + * Format: int64 + * @enum {integer} + */ + callRecording: 0 | 1 | 2 | 3 | 4 | 5; /** Format: int64 */ callStartTime: number; canDeleteConversation: boolean; @@ -308,8 +311,11 @@ export type components = { lobbyState: number; /** Format: int64 */ lobbyTimer: number; - /** Format: int64 */ - mentionPermissions: number; + /** + * Format: int64 + * @enum {integer} + */ + mentionPermissions: 0 | 1; /** Format: int64 */ messageExpiration: number; name: string; diff --git a/src/types/openapi/openapi-federation.ts b/src/types/openapi/openapi-federation.ts index abb288bd4cd..4778900fc99 100644 --- a/src/types/openapi/openapi-federation.ts +++ b/src/types/openapi/openapi-federation.ts @@ -322,8 +322,11 @@ export type components = { callFlag: number; /** Format: int64 */ callPermissions: number; - /** Format: int64 */ - callRecording: number; + /** + * Format: int64 + * @enum {integer} + */ + callRecording: 0 | 1 | 2 | 3 | 4 | 5; /** Format: int64 */ callStartTime: number; canDeleteConversation: boolean; @@ -355,8 +358,11 @@ export type components = { lobbyState: number; /** Format: int64 */ lobbyTimer: number; - /** Format: int64 */ - mentionPermissions: number; + /** + * Format: int64 + * @enum {integer} + */ + mentionPermissions: 0 | 1; /** Format: int64 */ messageExpiration: number; name: string; diff --git a/src/types/openapi/openapi-full.ts b/src/types/openapi/openapi-full.ts index c18d37bc5ce..059626348ff 100644 --- a/src/types/openapi/openapi-full.ts +++ b/src/types/openapi/openapi-full.ts @@ -2294,8 +2294,11 @@ export type components = { callFlag: number; /** Format: int64 */ callPermissions: number; - /** Format: int64 */ - callRecording: number; + /** + * Format: int64 + * @enum {integer} + */ + callRecording: 0 | 1 | 2 | 3 | 4 | 5; /** Format: int64 */ callStartTime: number; canDeleteConversation: boolean; @@ -2327,8 +2330,11 @@ export type components = { lobbyState: number; /** Format: int64 */ lobbyTimer: number; - /** Format: int64 */ - mentionPermissions: number; + /** + * Format: int64 + * @enum {integer} + */ + mentionPermissions: 0 | 1; /** Format: int64 */ messageExpiration: number; name: string; diff --git a/src/types/openapi/openapi.ts b/src/types/openapi/openapi.ts index a624393f9a0..4323d5eb863 100644 --- a/src/types/openapi/openapi.ts +++ b/src/types/openapi/openapi.ts @@ -1778,8 +1778,11 @@ export type components = { callFlag: number; /** Format: int64 */ callPermissions: number; - /** Format: int64 */ - callRecording: number; + /** + * Format: int64 + * @enum {integer} + */ + callRecording: 0 | 1 | 2 | 3 | 4 | 5; /** Format: int64 */ callStartTime: number; canDeleteConversation: boolean; @@ -1811,8 +1814,11 @@ export type components = { lobbyState: number; /** Format: int64 */ lobbyTimer: number; - /** Format: int64 */ - mentionPermissions: number; + /** + * Format: int64 + * @enum {integer} + */ + mentionPermissions: 0 | 1; /** Format: int64 */ messageExpiration: number; name: string;