fix the contacts-menu vcf-contact avatars

Signed-off-by: Simon L <szaimen@e.mail.de>
pull/36735/head
Simon L 1 year ago
parent b36a31c918
commit b38d2daede

@ -287,7 +287,13 @@ class ContactsStore implements IContactsStore {
if (isset($contact['UID'])) {
$uid = $contact['UID'];
$entry->setId($uid);
$avatar = $this->urlGenerator->linkToRouteAbsolute('core.avatar.getAvatar', ['userId' => $uid, 'size' => 64]);
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]);
} else {
$avatar = $this->urlGenerator->linkToRouteAbsolute('core.GuestAvatar.getAvatar', ['guestName' => $uid, 'size' => 64]);
}
$entry->setAvatar($avatar);
}

@ -142,7 +142,7 @@ class ContactsStoreTest extends TestCase {
$user = $this->createMock(IUser::class);
$this->urlGenerator->expects($this->any())
->method('linkToRouteAbsolute')
->with('core.avatar.getAvatar', $this->anything())
->with('core.GuestAvatar.getAvatar', $this->anything())
->willReturn('https://urlToNcAvatar.test');
$this->contactsManager->expects($this->once())
->method('search')

Loading…
Cancel
Save