Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2020-02-19 14:04:11 +01:00
Родитель 531b5a9aad
Коммит 0930c830b0
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 7076EA9751AACDDA
3 изменённых файлов: 25 добавлений и 0 удалений

Просмотреть файл

@ -42,3 +42,8 @@ title: Capabilities
## 8.0 ## 8.0
* `chat-replies` - Normal chat messages can now be replied to. Check the `isReplyable` parameter on the message object. * `chat-replies` - Normal chat messages can now be replied to. Check the `isReplyable` parameter on the message object.
* `circles-support` - Conversations can be created for circles and all circle members can be added to existing conversations * `circles-support` - Conversations can be created for circles and all circle members can be added to existing conversations
## 9.0
* `config => attachments => allowed` - Whether the user can upload files into a chat
* `config => attachments => folder` - User defined folder where items should be uploaded to

Просмотреть файл

@ -58,6 +58,13 @@ class Capabilities implements IPublicCapability {
$maxChatLength = ChatManager::MAX_CHAT_LENGTH; $maxChatLength = ChatManager::MAX_CHAT_LENGTH;
} }
$attachments = [
'allowed' => $user instanceof IUser,
];
if ($user instanceof IUser) {
$attachments['folder'] = $this->talkConfig->getAttachmentFolder($user->getUID());
}
return [ return [
'spreed' => [ 'spreed' => [
'features' => [ 'features' => [
@ -85,6 +92,7 @@ class Capabilities implements IPublicCapability {
'circles-support', 'circles-support',
], ],
'config' => [ 'config' => [
'attachments' => $attachments,
'chat' => [ 'chat' => [
'max-length' => $maxChatLength, 'max-length' => $maxChatLength,
], ],

Просмотреть файл

@ -96,6 +96,9 @@ class CapabilitiesTest extends TestCase {
'circles-support', 'circles-support',
], ],
'config' => [ 'config' => [
'attachments' => [
'allowed' => false,
],
'chat' => [ 'chat' => [
'max-length' => 1000, 'max-length' => 1000,
], ],
@ -121,6 +124,11 @@ class CapabilitiesTest extends TestCase {
->with($user) ->with($user)
->willReturn(false); ->willReturn(false);
$this->talkConfig->expects($this->once())
->method('getAttachmentFolder')
->with($user)
->willReturn('/Talk');
$this->serverConfig->expects($this->once()) $this->serverConfig->expects($this->once())
->method('getSystemValueString') ->method('getSystemValueString')
->with('version', '0.0.0') ->with('version', '0.0.0')
@ -154,6 +162,10 @@ class CapabilitiesTest extends TestCase {
'circles-support', 'circles-support',
], ],
'config' => [ 'config' => [
'attachments' => [
'allowed' => true,
'folder' => '/Talk',
],
'chat' => [ 'chat' => [
'max-length' => 32000, 'max-length' => 32000,
], ],