diff options
author | John Molakvoæ <skjnldsv@users.noreply.github.com> | 2022-10-27 14:26:27 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-27 14:26:27 +0200 |
commit | 04ec0d7f9717f80862f436a7b882eaf79322c3db (patch) | |
tree | cb7b4715f26725785fd749ce5926bf5fc479f3f6 | |
parent | 7710ea24bfe29c9ffab4bd8336d1493c3e7b5926 (diff) | |
parent | 7cdc579026ebe08127d1413f79fdaaafea95b7d6 (diff) | |
download | nextcloud-server-04ec0d7f9717f80862f436a7b882eaf79322c3db.tar.gz nextcloud-server-04ec0d7f9717f80862f436a7b882eaf79322c3db.zip |
Merge pull request #34440 from nextcloud/backport/32635/stable24
-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() { |