summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2024-05-10 12:08:24 +0200
committerJoas Schilling <coding@schilljs.com>2024-05-10 12:08:24 +0200
commitfb8a73c011802429138d5702ec1041fdfb81f780 (patch)
treefc0b693d9fd81ef0883635534cdf37e07481b4a2
parentbf240be8cfd5a2f1ce5035e9266b0315ede3f9b5 (diff)
fix(capabilities): Mark federation and signaling capabilities as local
Signed-off-by: Joas Schilling <coding@schilljs.com>
-rw-r--r--docs/capabilities.md12
-rw-r--r--lib/Capabilities.php18
-rw-r--r--tests/php/CapabilitiesTest.php8
3 files changed, 25 insertions, 13 deletions
diff --git a/docs/capabilities.md b/docs/capabilities.md
index 454481748..8e49a2b1f 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 58d44d58a..37ccbd289 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 @@ class Capabilities implements IPublicCapability {
'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 @@ class Capabilities implements IPublicCapability {
'recording' => $this->talkConfig->isRecordingEnabled(),
'recording-consent' => $this->talkConfig->recordingConsentRequired(),
'supported-reactions' => ['❤️', '🎉', '👏', '👍', '👎', '😂', '🤩', '🤔', '😲', '😥'],
+ // 'predefined-backgrounds' => list<string>,
+ '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 @@ class Capabilities implements IPublicCapability {
],
'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 @@ class Capabilities implements IPublicCapability {
}
$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 1ad094f79..69d72be55 100644
--- a/tests/php/CapabilitiesTest.php
+++ b/tests/php/CapabilitiesTest.php
@@ -115,8 +115,10 @@ class CapabilitiesTest extends TestCase {
'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 @@ class CapabilitiesTest extends TestCase {
'7_library.jpg',
'8_space_station.jpg',
],
- 'can-upload-background' => false,
- 'can-enable-sip' => false,
],
'chat' => [
'max-length' => 32000,
@@ -249,8 +249,10 @@ class CapabilitiesTest extends TestCase {
'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 @@ class CapabilitiesTest extends TestCase {
'7_library.jpg',
'8_space_station.jpg',
],
- 'can-upload-background' => $canUpload,
- 'can-enable-sip' => false,
],
'chat' => [
'max-length' => 32000,