Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/spreed.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2020-05-14 12:27:17 +0300
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>2020-05-14 17:24:08 +0300
commitf7ef6638995a9886300fcd97f394537d6a503d6a (patch)
treee3a0b8f5fd74a21aad846a339b7f85c3ec9a4dee /lib
parent80699155c2b9f37f56ef2f529c0a8b252ef06fc8 (diff)
Only send the capability when the config is set
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/Capabilities.php92
-rw-r--r--lib/Controller/RoomController.php1
2 files changed, 46 insertions, 47 deletions
diff --git a/lib/Capabilities.php b/lib/Capabilities.php
index 5e2f15f6d..3a31ad556 100644
--- a/lib/Capabilities.php
+++ b/lib/Capabilities.php
@@ -54,59 +54,57 @@ class Capabilities implements IPublicCapability {
return [];
}
- $maxChatLength = 1000;
- if (version_compare($this->serverConfig->getSystemValueString('version', '0.0.0'), '16.0.2', '>=')) {
- $maxChatLength = ChatManager::MAX_CHAT_LENGTH;
- }
-
- $attachments = [
- 'allowed' => $user instanceof IUser,
+ $capabilities = [
+ 'features' => [
+ 'audio',
+ 'video',
+ 'chat-v2',
+ 'conversation-v2',
+ 'guest-signaling',
+ 'empty-group-room',
+ 'guest-display-names',
+ 'multi-room-users',
+ 'favorites',
+ 'last-room-activity',
+ 'no-ping',
+ 'system-messages',
+ 'mention-flag',
+ 'in-call-flags',
+ 'notification-levels',
+ 'invite-groups-and-mails',
+ 'locked-one-to-one-rooms',
+ 'read-only-rooms',
+ 'chat-read-marker',
+ 'webinary-lobby',
+ 'start-call-flag',
+ 'chat-replies',
+ 'circles-support',
+ 'force-mute',
+ ],
+ 'config' => [
+ 'attachments' => [
+ 'allowed' => $user instanceof IUser,
+ ],
+ 'chat' => [
+ 'max-length' => ChatManager::MAX_CHAT_LENGTH,
+ ],
+ 'conversations' => [],
+ ],
];
+
if ($user instanceof IUser) {
- $attachments['folder'] = $this->talkConfig->getAttachmentFolder($user->getUID());
+ $capabilities['config']['attachments']['folder'] = $this->talkConfig->getAttachmentFolder($user->getUID());
}
- $conversations = [
- 'can-create' => $user instanceof IUser && !$this->talkConfig->isNotAllowedToCreateConversations($user),
- ];
+ $capabilities['config']['conversations']['can-create'] = $user instanceof IUser && !$this->talkConfig->isNotAllowedToCreateConversations($user);
+
+
+ if ($this->serverConfig->getAppValue('spreed', 'has_reference_id', 'no') === 'yes') {
+ $capabilities['features'][] = 'chat-reference-id';
+ }
return [
- 'spreed' => [
- 'features' => [
- 'audio',
- 'video',
- 'chat-v2',
- 'conversation-v2',
- 'guest-signaling',
- 'empty-group-room',
- 'guest-display-names',
- 'multi-room-users',
- 'favorites',
- 'last-room-activity',
- 'no-ping',
- 'system-messages',
- 'mention-flag',
- 'in-call-flags',
- 'notification-levels',
- 'invite-groups-and-mails',
- 'locked-one-to-one-rooms',
- 'read-only-rooms',
- 'chat-read-marker',
- 'webinary-lobby',
- 'start-call-flag',
- 'chat-replies',
- 'circles-support',
- 'force-mute',
- 'chat-reference-id',
- ],
- 'config' => [
- 'attachments' => $attachments,
- 'chat' => [
- 'max-length' => $maxChatLength,
- ],
- 'conversations' => $conversations,
- ],
- ],
+ 'spreed' => $capabilities,
];
}
}
diff --git a/lib/Controller/RoomController.php b/lib/Controller/RoomController.php
index 6fe5b9f56..b9f055129 100644
--- a/lib/Controller/RoomController.php
+++ b/lib/Controller/RoomController.php
@@ -133,6 +133,7 @@ class RoomController extends AEnvironmentAwareController {
$this->config->getAppValue('spreed', 'signaling_mode', '') . '#' .
$this->config->getAppValue('spreed', 'allowed_groups', '') . '#' .
$this->config->getAppValue('spreed', 'start_conversations', '') . '#' .
+ $this->config->getAppValue('spreed', 'has_reference_id', '') . '#' .
$this->config->getAppValue('theming', 'cachebuster', '1')
)];
}