Skip to content

Commit 59e542f

Browse files
committed
fix the contacts-menu vcf-contact avatars
Signed-off-by: Simon L <szaimen@e.mail.de>
1 parent b36a31c commit 59e542f

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

lib/private/Contacts/ContactsMenu/ContactsStore.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,8 +287,15 @@ private function contactArrayToEntry(array $contact): Entry {
287287
if (isset($contact['UID'])) {
288288
$uid = $contact['UID'];
289289
$entry->setId($uid);
290-
$avatar = $this->urlGenerator->linkToRouteAbsolute('core.avatar.getAvatar', ['userId' => $uid, 'size' => 64]);
291-
$entry->setAvatar($avatar);
290+
$avatar = '';
291+
if ($this->userManager->userExists($uid)) {
292+
$avatar = $this->urlGenerator->linkToRouteAbsolute('core.avatar.getAvatar', ['userId' => $uid, 'size' => 64]);
293+
} elseif (isset($contact['FN'])) {
294+
$avatar = $this->urlGenerator->linkToRouteAbsolute('core.GuestAvatar.getAvatar', ['guestName' => $contact['FN'], 'size' => 64]);
295+
}
296+
if ($avatar !== '') {
297+
$entry->setAvatar($avatar);
298+
}
292299
}
293300

294301
if (isset($contact['FN'])) {

0 commit comments

Comments
 (0)