Skip to content

Commit

Permalink
fixup! feat: add option to force passwords in public conversations
Browse files Browse the repository at this point in the history
  • Loading branch information
miaulalala committed Nov 13, 2024
1 parent 3db5a0a commit 018f683
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/Controller/RoomController.php
Original file line number Diff line number Diff line change
Expand Up @@ -500,12 +500,13 @@ protected function formatRoom(Room $room, ?Participant $currentParticipant, ?arr
* @param string $objectType Type of the object
* @param string $objectId ID of the object
* @param string $password The room password
* @return DataResponse<Http::STATUS_OK|Http::STATUS_CREATED, TalkRoom, array{}>|DataResponse<Http::STATUS_BAD_REQUEST, array{error?: string}, array{}>|DataResponse<Http::STATUS_FORBIDDEN|Http::STATUS_NOT_FOUND, array<empty>, array{}>
* @return DataResponse<Http::STATUS_OK|Http::STATUS_CREATED, TalkRoom, array{}>|DataResponse<Http::STATUS_BAD_REQUEST, array{error?: string}, array{}>|DataResponse<Http::STATUS_FORBIDDEN, array{hint: string, reason: 'breakout-room'|'type'|'value'}>|DataResponse<Http::STATUS_NOT_FOUND, array<empty>, array{}>

Check failure on line 503 in lib/Controller/RoomController.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis

MissingTemplateParam

lib/Controller/RoomController.php:503:13: MissingTemplateParam: OCP\AppFramework\Http\DataResponse has missing template params, expecting 3 (see https://psalm.dev/182)

Check failure on line 503 in lib/Controller/RoomController.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis

InvalidReturnType

lib/Controller/RoomController.php:503:13: InvalidReturnType: The declared return type 'OCP\AppFramework\Http\DataResponse<200|201|400|404, array{actorId?: string, actorType?: string, attendeeId?: int, attendeePermissions?: int, attendeePin?: null|string, avatarVersion?: string, breakoutRoomMode?: int, breakoutRoomStatus?: int, callFlag?: int, callPermissions?: int, callRecording?: int, callStartTime?: int, canDeleteConversation?: bool, canEnableSIP?: bool, canLeaveConversation?: bool, canStartCall?: bool, defaultPermissions?: int, description?: string, displayName?: string, error?: string, hasCall?: bool, hasPassword?: bool, id?: int, invitedActorId?: string, isArchived?: bool, isCustomAvatar?: bool, isFavorite?: bool, lastActivity?: int, lastCommonReadMessage?: int, lastMessage?: array{actorDisplayName?: string, actorId?: string, actorType?: string, deleted?: true, expirationTimestamp?: int, id?: int, isReplyable?: bool, lastEditActorDisplayName?: string, lastEditActorId?: string, lastEditActorType?: string, lastEditTimestamp?: int, markdown?: bool, message?: string, messageParameters?: array<string, array{'call-type'?: 'group'|'one2one'|'public', 'icon-url'?: string, 'message-id'?: string, 'preview-available'?: 'no'|'yes', assignable?: '0'|'1', blurhash?: string, boardname?: string, conversation?: string, description?: string, etag?: string, height?: string, id: string, latitude?: string, link?: string, longitude?: string, mimetype?: string, mtime?: string, name: string, path?: string, permissions?: string, server?: string, size?: string, stackname?: string, thumb?: string, type: string, visibility?: '0'|'1', website?: string, width?: string}>, messageType?: string, reactions?: array<string, int>|stdClass, reactionsSelf?: array<array-key, string>, referenceId?: string, silent?: bool, systemMessage?: string, timestamp?: int, token?: string}, lastPing?: int, lastReadMessage?: int, listable?: int, lobbyState?: int, lobbyTimer?: int, mentionPermissions?: int, messageExpiration?: int, name?: string, notificationCalls?: int, notificationLevel?: int, objectId?: string, objectType?: string, participantFlags?: int, participantType?: int, permissions?: int, readOnly?: int, recordingConsent?: int, remoteServer?: string, remoteToken?: string, sessionId?: string, sipEnabled?: int, status?: string, statusClearAt?: int|null, statusIcon?: null|string, statusMessage?: null|string, token?: string, type?: int, unreadMention?: bool, unreadMentionDirect?: bool, unreadMessages?: int}, array<never, never>>|OCP\AppFramework\Http\DataResponse<403, array{hint: string, reason: 'breakout-room'|'type'|'value'}>' for OCA\Talk\Controller\RoomController::createRoom is incorrect, got 'OCP\AppFramework\Http\DataResponse<200|201|400|403|404, array{actorId?: string, actorType?: string, attendeeId?: int, attendeePermissions?: int, attendeePin?: null|string, avatarVersion?: string, breakoutRoomMode?: int, breakoutRoomStatus?: int, callFlag?: int, callPermissions?: int, callRecording?: int, callStartTime?: int, canDeleteConversation?: bool, canEnableSIP?: bool, canLeaveConversation?: bool, canStartCall?: bool, defaultPermissions?: int, description?: string, displayName?: string, error?: string, hasCall?: bool, hasPassword?: bool, id?: int, invitedActorId?: string, isArchived?: bool, isCustomAvatar?: bool, isFavorite?: bool, lastActivity?: int, lastCommonReadMessage?: int, lastMessage?: array{actorDisplayName?: string, actorId?: string, actorType?: string, deleted?: true, expirationTimestamp?: int, id?: int, isReplyable?: bool, lastEditActorDisplayName?: string, lastEditActorId?: string, lastEditActorType?: string, lastEditTimestamp?: int, markdown?: bool, message?: string, messageParameters?: array<string, array{'call-type'?: 'group'|'one2one'|'public', 'icon-url'?: string, 'message-id'?: string, 'preview-available'?: 'no'|'yes', assignable?: '0'|'1', blurhash?: string, boardname?: string, conversation?: string, description?: string, etag?: string, height?: string, id: string, latitude?: string, link?: string, longitude?: string, mimetype?: string, mtime?:
*
* 200: Room already existed
* 201: Room created successfully
* 400: Room type invalid
* 403: Missing permissions to create room
* 403: Missing or invalid password
* 404: User, group or other target to invite was not found
*/
#[NoAdminRequired]
Expand Down Expand Up @@ -650,7 +651,7 @@ protected function createCircleRoom(string $targetCircleId): DataResponse {
}

/**
* @return DataResponse<Http::STATUS_CREATED, TalkRoom, array{}>|DataResponse<Http::STATUS_BAD_REQUEST, array{error?: string}, array{}>|DataResponse<Http::STATUS_NOT_FOUND, array<empty>, array{}>
* @return DataResponse<Http::STATUS_CREATED, TalkRoom, array{}>|DataResponse<Http::STATUS_BAD_REQUEST, array{error?: string}, array{}>|DataResponse<Http::STATUS_FORBIDDEN, array{hint: string, reason: 'breakout-room'|'type'|'value'}>|DataResponse<Http::STATUS_NOT_FOUND, array<empty>, array{}>

Check failure on line 654 in lib/Controller/RoomController.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis

MissingTemplateParam

lib/Controller/RoomController.php:654:13: MissingTemplateParam: OCP\AppFramework\Http\DataResponse has missing template params, expecting 3 (see https://psalm.dev/182)

Check failure on line 654 in lib/Controller/RoomController.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis

InvalidReturnType

lib/Controller/RoomController.php:654:13: InvalidReturnType: The declared return type 'OCP\AppFramework\Http\DataResponse<201|400|404, array{actorId?: string, actorType?: string, attendeeId?: int, attendeePermissions?: int, attendeePin?: null|string, avatarVersion?: string, breakoutRoomMode?: int, breakoutRoomStatus?: int, callFlag?: int, callPermissions?: int, callRecording?: int, callStartTime?: int, canDeleteConversation?: bool, canEnableSIP?: bool, canLeaveConversation?: bool, canStartCall?: bool, defaultPermissions?: int, description?: string, displayName?: string, error?: string, hasCall?: bool, hasPassword?: bool, id?: int, invitedActorId?: string, isArchived?: bool, isCustomAvatar?: bool, isFavorite?: bool, lastActivity?: int, lastCommonReadMessage?: int, lastMessage?: array{actorDisplayName?: string, actorId?: string, actorType?: string, deleted?: true, expirationTimestamp?: int, id?: int, isReplyable?: bool, lastEditActorDisplayName?: string, lastEditActorId?: string, lastEditActorType?: string, lastEditTimestamp?: int, markdown?: bool, message?: string, messageParameters?: array<string, array{'call-type'?: 'group'|'one2one'|'public', 'icon-url'?: string, 'message-id'?: string, 'preview-available'?: 'no'|'yes', assignable?: '0'|'1', blurhash?: string, boardname?: string, conversation?: string, description?: string, etag?: string, height?: string, id: string, latitude?: string, link?: string, longitude?: string, mimetype?: string, mtime?: string, name: string, path?: string, permissions?: string, server?: string, size?: string, stackname?: string, thumb?: string, type: string, visibility?: '0'|'1', website?: string, width?: string}>, messageType?: string, reactions?: array<string, int>|stdClass, reactionsSelf?: array<array-key, string>, referenceId?: string, silent?: bool, systemMessage?: string, timestamp?: int, token?: string}, lastPing?: int, lastReadMessage?: int, listable?: int, lobbyState?: int, lobbyTimer?: int, mentionPermissions?: int, messageExpiration?: int, name?: string, notificationCalls?: int, notificationLevel?: int, objectId?: string, objectType?: string, participantFlags?: int, participantType?: int, permissions?: int, readOnly?: int, recordingConsent?: int, remoteServer?: string, remoteToken?: string, sessionId?: string, sipEnabled?: int, status?: string, statusClearAt?: int|null, statusIcon?: null|string, statusMessage?: null|string, token?: string, type?: int, unreadMention?: bool, unreadMentionDirect?: bool, unreadMessages?: int}, array<never, never>>|OCP\AppFramework\Http\DataResponse<403, array{hint: string, reason: 'breakout-room'|'type'|'value'}>' for OCA\Talk\Controller\RoomController::createEmptyRoom is incorrect, got 'OCP\AppFramework\Http\DataResponse<201|400|403|404, array{actorId?: string, actorType?: string, attendeeId?: int, attendeePermissions?: int, attendeePin?: null|string, avatarVersion?: string, breakoutRoomMode?: int, breakoutRoomStatus?: int, callFlag?: int, callPermissions?: int, callRecording?: int, callStartTime?: int, canDeleteConversation?: bool, canEnableSIP?: bool, canLeaveConversation?: bool, canStartCall?: bool, defaultPermissions?: int, description?: string, displayName?: string, error?: 'mode'|'object'|'permissions'|'room', hasCall?: bool, hasPassword?: bool, hint?: string, id?: int, invitedActorId?: string, isArchived?: bool, isCustomAvatar?: bool, isFavorite?: bool, lastActivity?: int, lastCommonReadMessage?: int, lastMessage?: array{actorDisplayName?: string, actorId?: string, actorType?: string, deleted?: true, expirationTimestamp?: int, id?: int, isReplyable?: bool, lastEditActorDisplayName?: string, lastEditActorId?: string, lastEditActorType?: string, lastEditTimestamp?: int, markdown?: bool, message?: string, messageParameters?: array<string, array{'call-type'?: 'group'|'one2one'|'public', 'icon-url'?: string, 'message-id'?: string, 'preview-available'?: 'no'|'yes', assignable?: '0'|'1', blurhash?: string, boardname?: string, conversation?: string, description?: string, etag?: string, height?: string, id: string, latitude?: string, link?: string, longi
*/
#[NoAdminRequired]
protected function createEmptyRoom(string $roomName, bool $public = true, string $objectType = '', string $objectId = '', string $password = ''): DataResponse {
Expand Down

0 comments on commit 018f683

Please sign in to comment.