diff --git a/docs/capabilities.md b/docs/capabilities.md index 454481748d4..8e49a2b1ff9 100644 --- a/docs/capabilities.md +++ b/docs/capabilities.md @@ -101,8 +101,8 @@ * `silent-call` - Allow to start calls without sending notification * `talk-polls` - Polls feature is available to use in the chat * `config => call => enabled` - Whether calling is enabled on the instance or not -* `config => signaling => session-ping-limit` - Number of sessions the HPB is allowed to ping in the same request -* `config => signaling => hello-v2-token-key` - Public key to use when verifying JWT auth tokens for hello V2. +* `config => signaling => session-ping-limit` (local) - Number of sessions the HPB is allowed to ping in the same request +* `config => signaling => hello-v2-token-key` (local) - Public key to use when verifying JWT auth tokens for hello V2. ## 16 * `breakout-rooms-v1` - Whether breakout-rooms API v1 is available @@ -145,10 +145,10 @@ * `silent-send-state` - Whether messages contain a flag that they were sent silently * `chat-read-last` - Whether chat can be marked read without giving a message ID (will fall back to the conversations last message ID) * `federation-v1` - Whether basic chatting is possible with federation -* `config => federation => enabled` - Boolean, whether federation is enabled on instance -* `config => federation => incoming-enabled` - Boolean, whether users are allowed to be invited into federated conversations on other servers -* `config => federation => outgoing-enabled` - Boolean, whether users are allowed to invited federated users of other servers into conversations -* `config => federation => only-trusted-servers` - Boolean, whether federation invites are limited to trusted servers +* `config => federation => enabled` (local) - Boolean, whether federation is enabled on instance +* `config => federation => incoming-enabled` (local) - Boolean, whether users are allowed to be invited into federated conversations on other servers +* `config => federation => outgoing-enabled` (local) - Boolean, whether users are allowed to invited federated users of other servers into conversations +* `config => federation => only-trusted-servers` (local) - Boolean, whether federation invites are limited to trusted servers ## 20 * `ban-v1` - Whether the API to ban attendees is available diff --git a/lib/Capabilities.php b/lib/Capabilities.php index 58d44d58ada..37ccbd28977 100644 --- a/lib/Capabilities.php +++ b/lib/Capabilities.php @@ -130,9 +130,19 @@ class Capabilities implements IPublicCapability { 'conversations' => [ 'can-create', ], + 'federation' => [ + 'enabled', + 'incoming-enabled', + 'outgoing-enabled', + 'only-trusted-servers', + ], 'previews' => [ 'max-gif-size', ], + 'signaling' => [ + 'session-ping-limit', + 'hello-v2-token-key', + ], ]; protected ICache $talkCache; @@ -167,6 +177,7 @@ public function getCapabilities(): array { 'config' => [ 'attachments' => [ 'allowed' => $user instanceof IUser, + // 'folder' => string, ], 'call' => [ 'enabled' => ((int) $this->serverConfig->getAppValue('spreed', 'start_calls', (string) Room::START_CALL_EVERYONE)) !== Room::START_CALL_NOONE, @@ -174,8 +185,11 @@ public function getCapabilities(): array { 'recording' => $this->talkConfig->isRecordingEnabled(), 'recording-consent' => $this->talkConfig->recordingConsentRequired(), 'supported-reactions' => ['❤️', '🎉', '👏', '👍', '👎', '😂', '🤩', '🤔', '😲', '😥'], + // 'predefined-backgrounds' => list, + 'can-upload-background' => false, 'sip-enabled' => $this->talkConfig->isSIPConfigured(), 'sip-dialout-enabled' => $this->talkConfig->isSIPDialOutEnabled(), + 'can-enable-sip' => false, ], 'chat' => [ 'max-length' => ChatManager::MAX_CHAT_LENGTH, @@ -197,6 +211,7 @@ public function getCapabilities(): array { ], 'signaling' => [ 'session-ping-limit' => max(0, (int)$this->serverConfig->getAppValue('spreed', 'session-ping-limit', '200')), + // 'hello-v2-token-key' => string, ], ], 'config-local' => self::LOCAL_CONFIGS, @@ -277,9 +292,6 @@ public function getCapabilities(): array { } $capabilities['config']['call']['can-upload-background'] = $quota === 'none' || $quota > 0; $capabilities['config']['call']['can-enable-sip'] = $this->talkConfig->canUserEnableSIP($user); - } else { - $capabilities['config']['call']['can-upload-background'] = false; - $capabilities['config']['call']['can-enable-sip'] = false; } return [ diff --git a/tests/php/CapabilitiesTest.php b/tests/php/CapabilitiesTest.php index 1ad094f7923..69d72be55f2 100644 --- a/tests/php/CapabilitiesTest.php +++ b/tests/php/CapabilitiesTest.php @@ -115,8 +115,10 @@ public function testGetCapabilitiesGuest(): void { 'recording' => false, 'recording-consent' => 0, 'supported-reactions' => ['❤️', '🎉', '👏', '👍', '👎', '😂', '🤩', '🤔', '😲', '😥'], + 'can-upload-background' => false, 'sip-enabled' => false, 'sip-dialout-enabled' => false, + 'can-enable-sip' => false, 'predefined-backgrounds' => [ '1_office.jpg', '2_home.jpg', @@ -127,8 +129,6 @@ public function testGetCapabilitiesGuest(): void { '7_library.jpg', '8_space_station.jpg', ], - 'can-upload-background' => false, - 'can-enable-sip' => false, ], 'chat' => [ 'max-length' => 32000, @@ -249,8 +249,10 @@ public function testGetCapabilitiesUserAllowed(bool $isNotAllowed, bool $canCrea 'recording' => false, 'recording-consent' => 0, 'supported-reactions' => ['❤️', '🎉', '👏', '👍', '👎', '😂', '🤩', '🤔', '😲', '😥'], + 'can-upload-background' => $canUpload, 'sip-enabled' => false, 'sip-dialout-enabled' => false, + 'can-enable-sip' => false, 'predefined-backgrounds' => [ '1_office.jpg', '2_home.jpg', @@ -261,8 +263,6 @@ public function testGetCapabilitiesUserAllowed(bool $isNotAllowed, bool $canCrea '7_library.jpg', '8_space_station.jpg', ], - 'can-upload-background' => $canUpload, - 'can-enable-sip' => false, ], 'chat' => [ 'max-length' => 32000,