Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions lib/Chat/ChatManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -1105,13 +1105,20 @@ public function addConversationNotify(array $results, string $search, Room $room
}
if ($search === '' || $this->searchIsPartOfConversationNameOrAtAll($search, $roomDisplayName)) {
$participantCount = $this->participantService->getNumberOfUsers($room);
$results[] = [

$atAllResult = [
'id' => 'all',
'label' => $roomDisplayName,
'details' => $this->l->n('All %n participant', 'All %n participants', $participantCount),
'source' => 'calls',
'mentionId' => 'all',
];

if ($participantCount > 1) {
// TRANSLATORS The string will only be used with more than 1 participant, so you can keep the "All" in all plural forms
$atAllResult['details'] = $this->l->n('All %n participant', 'All %n participants', $participantCount);
}

$results[] = $atAllResult;
}
return $results;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/features/chat-2/mentions.feature
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Feature: chat/mentions
| roomName | room |
Then user "participant1" gets the following candidate mentions in room "group room" for "" with 200
| id | label | source | mentionId | details |
| all | room | calls | all | All 1 participant |
| all | room | calls | all | |

Scenario: get mentions in a group room
When user "participant1" creates room "group room" (v4)
Expand Down
2 changes: 1 addition & 1 deletion tests/php/Chat/ChatManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -749,7 +749,7 @@ public static function dataAddConversationNotify(): array {
'actor_id' => 'user',
])],
1,
[['id' => 'all', 'label' => 'test', 'source' => 'calls', 'mentionId' => 'all', 'details' => 'All 1 participant']],
[['id' => 'all', 'label' => 'test', 'source' => 'calls', 'mentionId' => 'all']],
],
[
'all',
Expand Down
Loading