From 442aba327ec04f67b85bdffb85fd236c5e12bbdd Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Mon, 13 Mar 2023 14:13:03 -0300 Subject: [PATCH] Fix avatar url Signed-off-by: Vitor Mattos --- lib/Search/ConversationSearch.php | 28 ++-------------------------- 1 file changed, 2 insertions(+), 26 deletions(-) diff --git a/lib/Search/ConversationSearch.php b/lib/Search/ConversationSearch.php index d5805dd8f89..f4b99954c7d 100644 --- a/lib/Search/ConversationSearch.php +++ b/lib/Search/ConversationSearch.php @@ -117,36 +117,12 @@ public function search(IUser $user, ISearchQuery $query): SearchResult { } } - $icon = ''; - $iconClass = ''; - if ($room->getType() === Room::TYPE_ONE_TO_ONE) { - $users = json_decode($room->getName(), true); - foreach ($users as $participantId) { - if ($participantId !== $user->getUID()) { - $icon = $this->url->linkToRouteAbsolute('core.avatar.getAvatar', [ - 'userId' => $participantId, - 'size' => 512, - ]); - } - } - } elseif ($room->getObjectType() === 'file') { - $iconClass = 'conversation-icon icon-file-white'; - } elseif ($room->getObjectType() === 'share:password') { - $iconClass = 'conversation-icon icon-password-white'; - } elseif ($room->getObjectType() === 'emails') { - $iconClass = 'conversation-icon icon-mail-white'; - } elseif ($room->getType() === Room::TYPE_PUBLIC) { - $iconClass = 'conversation-icon icon-public-white'; - } else { - $iconClass = 'conversation-icon icon-contacts-white'; - } - $entry = new SearchResultEntry( - $icon, + $this->avatarService->getAvatarUrl($room), $room->getDisplayName($user->getUID()), '', $this->url->linkToRouteAbsolute('spreed.Page.showCall', ['token' => $room->getToken()]), - $iconClass, + '', true );