diff options
-rw-r--r-- | apps/accessibility/css/dark.scss | 1 | ||||
-rw-r--r-- | lib/private/Contacts/ContactsMenu/ContactsStore.php | 7 | ||||
-rw-r--r-- | tests/lib/Contacts/ContactsMenu/ContactsStoreTest.php | 6 |
3 files changed, 10 insertions, 4 deletions
diff --git a/apps/accessibility/css/dark.scss b/apps/accessibility/css/dark.scss index 6cced2997bc..f6c8da9596f 100644 --- a/apps/accessibility/css/dark.scss +++ b/apps/accessibility/css/dark.scss @@ -26,7 +26,6 @@ $image-logoheader: url('../../../core/img/logo/logo.svg?v=1'); #app-navigation > ul > li > a:first-child, #app-navigation > ul > li > ul > li > a:first-child, -#contactsmenu-menu a, #expanddiv a, .activity-section .activity-icon.monochrome { & > img, diff --git a/lib/private/Contacts/ContactsMenu/ContactsStore.php b/lib/private/Contacts/ContactsMenu/ContactsStore.php index 0ac388ce00a..4a8e699ae0e 100644 --- a/lib/private/Contacts/ContactsMenu/ContactsStore.php +++ b/lib/private/Contacts/ContactsMenu/ContactsStore.php @@ -312,8 +312,11 @@ class ContactsStore implements IContactsStore { private function contactArrayToEntry(array $contact) { $entry = new Entry(); - if (isset($contact['id'])) { - $entry->setId($contact['id']); + if (isset($contact['UID'])) { + $uid = $contact['UID']; + $entry->setId($uid); + $avatar = $this->urlGenerator->linkToRouteAbsolute('core.avatar.getAvatar', ['userId' => $uid, 'size' => 64]); + $entry->setAvatar($avatar); } if (isset($contact['FN'])) { diff --git a/tests/lib/Contacts/ContactsMenu/ContactsStoreTest.php b/tests/lib/Contacts/ContactsMenu/ContactsStoreTest.php index bd82c203ff5..9d272c7dda4 100644 --- a/tests/lib/Contacts/ContactsMenu/ContactsStoreTest.php +++ b/tests/lib/Contacts/ContactsMenu/ContactsStoreTest.php @@ -141,6 +141,10 @@ class ContactsStoreTest extends TestCase { public function testGetContactsWithoutBinaryImage() { /** @var IUser|\PHPUnit\Framework\MockObject\MockObject $user */ $user = $this->createMock(IUser::class); + $this->urlGenerator->expects($this->any()) + ->method('linkToRouteAbsolute') + ->with('core.avatar.getAvatar', $this->anything()) + ->willReturn('https://urlToNcAvatar.test'); $this->contactsManager->expects($this->once()) ->method('search') ->with($this->equalTo(''), $this->equalTo(['FN', 'EMAIL'])) @@ -164,7 +168,7 @@ class ContactsStoreTest extends TestCase { $entries = $this->contactsStore->getContacts($user, ''); $this->assertCount(2, $entries); - $this->assertNull($entries[1]->getAvatar()); + $this->assertSame('https://urlToNcAvatar.test', $entries[1]->getAvatar()); } public function testGetContactsWithoutAvatarURI() { |