зеркало из https://github.com/nextcloud/spreed.git
Add a capability
Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Родитель
531b5a9aad
Коммит
0930c830b0
|
@ -42,3 +42,8 @@ title: Capabilities
|
|||
## 8.0
|
||||
* `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
|
||||
|
||||
|
||||
## 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;
|
||||
}
|
||||
|
||||
$attachments = [
|
||||
'allowed' => $user instanceof IUser,
|
||||
];
|
||||
if ($user instanceof IUser) {
|
||||
$attachments['folder'] = $this->talkConfig->getAttachmentFolder($user->getUID());
|
||||
}
|
||||
|
||||
return [
|
||||
'spreed' => [
|
||||
'features' => [
|
||||
|
@ -85,6 +92,7 @@ class Capabilities implements IPublicCapability {
|
|||
'circles-support',
|
||||
],
|
||||
'config' => [
|
||||
'attachments' => $attachments,
|
||||
'chat' => [
|
||||
'max-length' => $maxChatLength,
|
||||
],
|
||||
|
|
|
@ -96,6 +96,9 @@ class CapabilitiesTest extends TestCase {
|
|||
'circles-support',
|
||||
],
|
||||
'config' => [
|
||||
'attachments' => [
|
||||
'allowed' => false,
|
||||
],
|
||||
'chat' => [
|
||||
'max-length' => 1000,
|
||||
],
|
||||
|
@ -121,6 +124,11 @@ class CapabilitiesTest extends TestCase {
|
|||
->with($user)
|
||||
->willReturn(false);
|
||||
|
||||
$this->talkConfig->expects($this->once())
|
||||
->method('getAttachmentFolder')
|
||||
->with($user)
|
||||
->willReturn('/Talk');
|
||||
|
||||
$this->serverConfig->expects($this->once())
|
||||
->method('getSystemValueString')
|
||||
->with('version', '0.0.0')
|
||||
|
@ -154,6 +162,10 @@ class CapabilitiesTest extends TestCase {
|
|||
'circles-support',
|
||||
],
|
||||
'config' => [
|
||||
'attachments' => [
|
||||
'allowed' => true,
|
||||
'folder' => '/Talk',
|
||||
],
|
||||
'chat' => [
|
||||
'max-length' => 32000,
|
||||
],
|
||||
|
|
Загрузка…
Ссылка в новой задаче