aboutsummaryrefslogtreecommitdiffstats
path: root/apps/dav/lib/CalDAV/Schedule
diff options
context:
space:
mode:
authorAnna Larch <anna@nextcloud.com>2022-08-18 13:44:46 +0200
committerAnna Larch <anna@nextcloud.com>2022-11-03 10:26:34 +0100
commite5c290bb7f7ea361feadab337bc8fe51531bb529 (patch)
tree1848c8c03234ed69b7f7c509a05d1b5a45e6c7a4 /apps/dav/lib/CalDAV/Schedule
parentbfb764b5f3a26add7059391134c86a1fca460dfd (diff)
downloadnextcloud-server-e5c290bb7f7ea361feadab337bc8fe51531bb529.tar.gz
nextcloud-server-e5c290bb7f7ea361feadab337bc8fe51531bb529.zip
Switch to DisplayNameCache for CalDAV
Signed-off-by: Anna Larch <anna@nextcloud.com>
Diffstat (limited to 'apps/dav/lib/CalDAV/Schedule')
-rw-r--r--apps/dav/lib/CalDAV/Schedule/IMipPlugin.php9
1 files changed, 2 insertions, 7 deletions
diff --git a/apps/dav/lib/CalDAV/Schedule/IMipPlugin.php b/apps/dav/lib/CalDAV/Schedule/IMipPlugin.php
index 2c7b06a4396..91610682ef2 100644
--- a/apps/dav/lib/CalDAV/Schedule/IMipPlugin.php
+++ b/apps/dav/lib/CalDAV/Schedule/IMipPlugin.php
@@ -178,12 +178,7 @@ class IMipPlugin extends SabreIMipPlugin {
$recipientName = $iTipMessage->recipientName ?: null;
if ($senderName === null || empty(trim($senderName))) {
- $user = $this->userManager->get($this->userId);
- if ($user) {
- // getDisplayName automatically uses the uid
- // if no display-name is set
- $senderName = $user->getDisplayName();
- }
+ $sender = $this->userManager->getDisplayName($this->userId) ?? $this->userId;
}
/** @var VEvent $vevent */
@@ -225,7 +220,7 @@ class IMipPlugin extends SabreIMipPlugin {
];
$fromEMail = Util::getDefaultEmailAddress('invitations-noreply');
- $fromName = $l10n->t('%1$s via %2$s', [$senderName, $this->defaults->getName()]);
+ $fromName = $l10n->t('%1$s via %2$s', [$senderName ?? $this->userId, $this->defaults->getName()]);
$message = $this->mailer->createMessage()
->setFrom([$fromEMail => $fromName])