diff options
author | Joas Schilling <coding@schilljs.com> | 2022-08-19 00:09:46 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2022-08-19 10:23:16 +0200 |
commit | ae67eba84bb796ad7f3a074ec3d98126d0e5784f (patch) | |
tree | 11e18c554670883d41d96140780bdbf78655279e /apps/comments/lib | |
parent | cab0f1327e28104ef61e8767f963d20cf38544af (diff) | |
download | nextcloud-server-ae67eba84bb796ad7f3a074ec3d98126d0e5784f.tar.gz nextcloud-server-ae67eba84bb796ad7f3a074ec3d98126d0e5784f.zip |
Use user displayname cache for comment mentions
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps/comments/lib')
-rw-r--r-- | apps/comments/lib/Notification/Notifier.php | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/apps/comments/lib/Notification/Notifier.php b/apps/comments/lib/Notification/Notifier.php index 7c6a40133ee..4ddb7295bfe 100644 --- a/apps/comments/lib/Notification/Notifier.php +++ b/apps/comments/lib/Notification/Notifier.php @@ -100,9 +100,9 @@ class Notifier implements INotifier { $displayName = $comment->getActorId(); $isDeletedActor = $comment->getActorType() === ICommentsManager::DELETED_USER; if ($comment->getActorType() === 'users') { - $commenter = $this->userManager->get($comment->getActorId()); - if ($commenter instanceof IUser) { - $displayName = $commenter->getDisplayName(); + $commenter = $this->userManager->getDisplayName($comment->getActorId()); + if ($commenter !== null) { + $displayName = $commenter; } } @@ -171,8 +171,8 @@ class Notifier implements INotifier { $mentions = $comment->getMentions(); foreach ($mentions as $mention) { if ($mention['type'] === 'user') { - $user = $this->userManager->get($mention['id']); - if (!$user instanceof IUser) { + $userDisplayName = $this->userManager->getDisplayName($mention['id']); + if ($userDisplayName === null) { continue; } } |