diff options
author | Joas Schilling <coding@schilljs.com> | 2021-05-07 13:43:25 +0300 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2021-05-07 13:43:25 +0300 |
commit | 06da3fdf19bfbf7fe27ba43f462e13990e6416ba (patch) | |
tree | aed695246d98cbf801699bcd9167baa2a7a3fbb6 | |
parent | 693c22d9094eb6ea8804493e54990499f9e6c570 (diff) |
Remove the description from the system message
Looked a bit too weird in some clients with multiline descriptions and the quotes
Signed-off-by: Joas Schilling <coding@schilljs.com>
-rw-r--r-- | docs/chat.md | 2 | ||||
-rw-r--r-- | lib/Chat/Parser/SystemMessage.php | 6 | ||||
-rw-r--r-- | tests/integration/features/conversation/lobby.feature | 12 | ||||
-rw-r--r-- | tests/php/Chat/Parser/SystemMessageTest.php | 4 |
4 files changed, 12 insertions, 12 deletions
diff --git a/docs/chat.md b/docs/chat.md index b7aee6a52..1f5b70387 100644 --- a/docs/chat.md +++ b/docs/chat.md @@ -219,7 +219,7 @@ See [OCP\RichObjectStrings\Definitions](https://github.com/nextcloud/server/blob * `conversation_created` - {actor} created the conversation * `conversation_renamed` - {actor} renamed the conversation from "foo" to "bar" -* `description_set` - {actor} set the description to "Hello world" +* `description_set` - {actor} set the description * `description_removed` - {actor} removed the description * `call_started` - {actor} started a call * `call_joined` - {actor} joined the call diff --git a/lib/Chat/Parser/SystemMessage.php b/lib/Chat/Parser/SystemMessage.php index 9164cbed2..44d53ccd4 100644 --- a/lib/Chat/Parser/SystemMessage.php +++ b/lib/Chat/Parser/SystemMessage.php @@ -123,11 +123,11 @@ class SystemMessage { $parsedMessage = $this->l->t('An administrator renamed the conversation from "%1$s" to "%2$s"', [$parameters['oldName'], $parameters['newName']]); } } elseif ($message === 'description_set') { - $parsedMessage = $this->l->t('{actor} set the description to "%1$s"', [$parameters['newDescription']]); + $parsedMessage = $this->l->t('{actor} set the description'); if ($currentUserIsActor) { - $parsedMessage = $this->l->t('You set the description to "%1$s"', [$parameters['newDescription']]); + $parsedMessage = $this->l->t('You set the description'); } elseif ($cliIsActor) { - $parsedMessage = $this->l->t('An administrator set the description to "%1$s"', [$parameters['newDescription']]); + $parsedMessage = $this->l->t('An administrator set the description'); } } elseif ($message === 'description_removed') { $parsedMessage = $this->l->t('{actor} removed the description'); diff --git a/tests/integration/features/conversation/lobby.feature b/tests/integration/features/conversation/lobby.feature index 7e5b7cf33..d729a037d 100644 --- a/tests/integration/features/conversation/lobby.feature +++ b/tests/integration/features/conversation/lobby.feature @@ -232,11 +232,11 @@ Feature: conversation/lobby And user "participant1" sends message "Message 1" to room "room" with 201 And user "participant1" sets description for room "room" to "the description" with 200 (v4) Then user "participant1" is participant of room "room" (v4) - | name | description | type | participantType | lastMessage | - | room | the description | 3 | 1 | You set the description to "the description" | + | name | description | type | participantType | lastMessage | + | room | the description | 3 | 1 | You set the description | And user "participant2" is participant of room "room" (v4) - | name | description | type | participantType | lastMessage | - | room | the description | 3 | 2 | {actor} set the description to "the description" | + | name | description | type | participantType | lastMessage | + | room | the description | 3 | 2 | {actor} set the description | And user "participant3" is participant of room "room" (v4) | name | description | type | participantType | lastMessage | | room | the description | 3 | 3 | | @@ -244,8 +244,8 @@ Feature: conversation/lobby | name | description | type | participantType | lastMessage | | room | the description | 3 | 5 | | And user "guest" is participant of room "room" (v4) - | name | description | type | participantType | lastMessage | - | room | the description | 3 | 6 | {actor} set the description to "the description" | + | name | description | type | participantType | lastMessage | + | room | the description | 3 | 6 | {actor} set the description | And user "guest2" is participant of room "room" (v4) | name | description | type | participantType | lastMessage | | room | the description | 3 | 4 | | diff --git a/tests/php/Chat/Parser/SystemMessageTest.php b/tests/php/Chat/Parser/SystemMessageTest.php index 8b86a95cc..2bf100973 100644 --- a/tests/php/Chat/Parser/SystemMessageTest.php +++ b/tests/php/Chat/Parser/SystemMessageTest.php @@ -138,11 +138,11 @@ class SystemMessageTest extends TestCase { ['actor' => ['id' => 'actor', 'type' => 'user']], ], ['description_set', ['newDescription' => 'New description'], 'recipient', - '{actor} set the description to "New description"', + '{actor} set the description', ['actor' => ['id' => 'actor', 'type' => 'user']], ], ['description_set', ['newDescription' => 'New description'], 'actor', - 'You set the description to "New description"', + 'You set the description', ['actor' => ['id' => 'actor', 'type' => 'user']], ], ['description_removed', [], 'recipient', |