Skip to content

Commit

Permalink
fix the contacts-menu vcf-contact avatars
Browse files Browse the repository at this point in the history
Signed-off-by: Simon L <szaimen@e.mail.de>
  • Loading branch information
szaimen committed Feb 15, 2023
1 parent b36a31c commit 55ebbb4
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions lib/private/Contacts/ContactsMenu/ContactsStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,15 @@ private function contactArrayToEntry(array $contact): Entry {
if (isset($contact['UID'])) {
$uid = $contact['UID'];
$entry->setId($uid);
$avatar = $this->urlGenerator->linkToRouteAbsolute('core.avatar.getAvatar', ['userId' => $uid, 'size' => 64]);
$entry->setAvatar($avatar);
$avatar = '';
if (isset($contact['isLocalSystemBook'])) {
$avatar = $this->urlGenerator->linkToRouteAbsolute('core.avatar.getAvatar', ['userId' => $uid, 'size' => 64]);
} elseif (isset($contact['FN'])) {
$avatar = $this->urlGenerator->linkToRouteAbsolute('core.GuestAvatar.getAvatar', ['guestName' => $contact['FN'], 'size' => 64]);
}
if ($avatar !== '') {
$entry->setAvatar($avatar);
}
}

if (isset($contact['FN'])) {
Expand Down

0 comments on commit 55ebbb4

Please sign in to comment.