diff options
author | Joas Schilling <coding@schilljs.com> | 2022-08-18 10:14:17 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2022-08-19 12:06:22 +0200 |
commit | 97a955f2342f826ed5352021f665c07b78943e90 (patch) | |
tree | 394b326cef782d6a9f561c803d5cf34e84234d1f /lib | |
parent | e32de5d5f9ea86cc66dbd472b0aee09fc81f7113 (diff) |
Use user displayname cache when creating room names
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Manager.php | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/Manager.php b/lib/Manager.php index f72fc5c5b..1e2798ee0 100644 --- a/lib/Manager.php +++ b/lib/Manager.php @@ -1002,8 +1002,8 @@ class Manager { } if ($otherParticipant === '' && $room->getName() !== '') { - $user = $this->userManager->get($room->getName()); - $otherParticipant = $user instanceof IUser ? $user->getDisplayName() : $this->l->t('Deleted user (%s)', $room->getName()); + $userDisplayName = $this->userManager->getDisplayName($room->getName()); + $otherParticipant = $userDisplayName ?? $this->l->t('Deleted user (%s)', $room->getName()); } return $otherParticipant; @@ -1054,8 +1054,7 @@ class Manager { $displayNames = []; foreach ($users as $participantId) { - $user = $this->userManager->get($participantId); - $displayNames[] = $user instanceof IUser ? $user->getDisplayName() : $participantId; + $displayNames[] = $this->userManager->getDisplayName($participantId) ?? $participantId; } $roomName = implode(', ', $displayNames); |