Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/spreed.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2022-07-13 16:58:12 +0300
committerbackportbot-nextcloud[bot] <backportbot-nextcloud[bot]@users.noreply.github.com>2022-07-13 18:25:58 +0300
commitaf6feb29c316dad56ae8bc75f0fa558e7d211009 (patch)
treed922a90fb6fa9422c1834831938e1ea9ab841685
parentde4c4175fec2353e0b34ef7ae4beaf41e4652aa7 (diff)
Fix guest names in search resultsbackport/7585/stable23
Signed-off-by: Joas Schilling <coding@schilljs.com>
-rw-r--r--lib/Search/MessageSearch.php11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/Search/MessageSearch.php b/lib/Search/MessageSearch.php
index cd442e8cf..472d9532d 100644
--- a/lib/Search/MessageSearch.php
+++ b/lib/Search/MessageSearch.php
@@ -206,11 +206,20 @@ class MessageSearch implements IProvider {
$subline = '{user}';
}
+ $displayName = $message->getActorDisplayName();
+ if ($message->getActorType() === Attendee::ACTOR_GUESTS) {
+ if ($displayName === '') {
+ $displayName = $this->l->t('Guest');
+ } else {
+ $displayName = $this->l->t('%s (guest)', $displayName);
+ }
+ }
+
$entry = new SearchResultEntry(
$iconUrl,
str_replace(
['{user}', '{conversation}'],
- [$message->getActorDisplayName(), $room->getDisplayName($user->getUID())],
+ [$displayName, $room->getDisplayName($user->getUID())],
$subline
),
$messageStr,