Skip to content

Commit

Permalink
Change system message string
Browse files Browse the repository at this point in the history
Signed-off-by: Joas Schilling <[email protected]>
  • Loading branch information
nickvergessen committed Jul 7, 2021
1 parent 31a32b6 commit b138414
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion docs/chat.md
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ See [OCP\RichObjectStrings\Definitions](https://github.com/nextcloud/server/blob
* `guest_moderator_promoted` - {actor} promoted {user} to moderator
* `guest_moderator_demoted` - {actor} demoted {user} from moderator
* `message_deleted` - Message deleted by {actor} (Should not be shown to the user)
* `cleared_history` - {actor} cleared the history of the conversation
* `history_cleared` - {actor} cleared the history of the conversation
* `file_shared` - {file}
* `object_shared` - {object}
* `matterbridge_config_added` - {actor} set up Matterbridge to synchronize this conversation with other chats
Expand Down
2 changes: 1 addition & 1 deletion lib/Chat/ChatManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ public function clearHistory(Room $chat, string $actorType, string $actorId): IC
$chat,
$actorType,
$actorId,
json_encode(['message' => 'cleared_history', 'parameters' => []]),
json_encode(['message' => 'history_cleared', 'parameters' => []]),
$this->timeFactory->getDateTime(),
false
);
Expand Down
2 changes: 1 addition & 1 deletion lib/Chat/Parser/SystemMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ public function parseMessage(Message $chatMessage): void {
if ($currentUserIsActor) {
$parsedMessage = $this->l->t('You deleted a message');
}
} elseif ($message === 'cleared_history') {
} elseif ($message === 'history_cleared') {
$parsedMessage = $this->l->t('{actor} cleared the history of the conversation');
if ($currentUserIsActor) {
$parsedMessage = $this->l->t('You cleared the history of the conversation');
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/features/chat/delete.feature
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ Feature: chat/reply
| room | actorType | actorId | actorDisplayName | message | messageParameters |
Then user "participant1" sees the following system messages in room "room1" with 200 (v1)
| room | actorType | actorId | actorDisplayName | systemMessage |
| room1 | users | participant1 | participant1-displayname | cleared_history |
| room1 | users | participant1 | participant1-displayname | history_cleared |
Then user "participant2" sees the following system messages in room "room1" with 200 (v1)
| room | actorType | actorId | actorDisplayName | systemMessage |
| room1 | users | participant1 | participant1-displayname | cleared_history |
| room1 | users | participant1 | participant1-displayname | history_cleared |
2 changes: 1 addition & 1 deletion tests/php/Chat/ChatManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ public function testClearHistory(): void {
$chat,
'users',
'admin',
json_encode(['message' => 'cleared_history', 'parameters' => []]),
json_encode(['message' => 'history_cleared', 'parameters' => []]),
$date,
false
);
Expand Down

0 comments on commit b138414

Please sign in to comment.