diff options
author | Anna Larch <anna@nextcloud.com> | 2022-08-18 13:45:13 +0200 |
---|---|---|
committer | Anna Larch <anna@nextcloud.com> | 2022-11-03 10:26:34 +0100 |
commit | 9dd51601c666a55317a98204c47968fa30baf15f (patch) | |
tree | a8c290e64c4ad21d08395800bfe0b21e5e12904e /apps/dav | |
parent | e5c290bb7f7ea361feadab337bc8fe51531bb529 (diff) | |
download | nextcloud-server-9dd51601c666a55317a98204c47968fa30baf15f.tar.gz nextcloud-server-9dd51601c666a55317a98204c47968fa30baf15f.zip |
Switch to DisplayNameCache for CardDAV
Signed-off-by: Anna Larch <anna@nextcloud.com>
Diffstat (limited to 'apps/dav')
-rw-r--r-- | apps/dav/lib/CalDAV/Schedule/IMipPlugin.php | 2 | ||||
-rw-r--r-- | apps/dav/lib/CardDAV/CardDavBackend.php | 16 |
2 files changed, 2 insertions, 16 deletions
diff --git a/apps/dav/lib/CalDAV/Schedule/IMipPlugin.php b/apps/dav/lib/CalDAV/Schedule/IMipPlugin.php index 91610682ef2..515072fd227 100644 --- a/apps/dav/lib/CalDAV/Schedule/IMipPlugin.php +++ b/apps/dav/lib/CalDAV/Schedule/IMipPlugin.php @@ -178,7 +178,7 @@ class IMipPlugin extends SabreIMipPlugin { $recipientName = $iTipMessage->recipientName ?: null; if ($senderName === null || empty(trim($senderName))) { - $sender = $this->userManager->getDisplayName($this->userId) ?? $this->userId; + $senderName = $this->userManager->getDisplayName($this->userId); } /** @var VEvent $vevent */ diff --git a/apps/dav/lib/CardDAV/CardDavBackend.php b/apps/dav/lib/CardDAV/CardDavBackend.php index 72499ad3037..03ddb93c084 100644 --- a/apps/dav/lib/CardDAV/CardDavBackend.php +++ b/apps/dav/lib/CardDAV/CardDavBackend.php @@ -207,7 +207,7 @@ class CardDavBackend implements BackendInterface, SyncSupport { [, $name] = \Sabre\Uri\split($row['principaluri']); $uri = $row['uri'] . '_shared_by_' . $name; - $displayName = $row['displayname'] . ' (' . $this->getUserDisplayName($name) . ')'; + $displayName = $row['displayname'] . ' (' . ($this->userManager->getDisplayName($name) ?? $name ?? '') . ')'; $addressBooks[$row['id']] = [ 'id' => $row['id'], @@ -256,20 +256,6 @@ class CardDavBackend implements BackendInterface, SyncSupport { return array_values($addressBooks); } - private function getUserDisplayName($uid) { - if (!isset($this->userDisplayNames[$uid])) { - $user = $this->userManager->get($uid); - - if ($user instanceof IUser) { - $this->userDisplayNames[$uid] = $user->getDisplayName(); - } else { - $this->userDisplayNames[$uid] = $uid; - } - } - - return $this->userDisplayNames[$uid]; - } - /** * @param int $addressBookId */ |