Skip to content

Commit

Permalink
Fix avatar url
Browse files Browse the repository at this point in the history
Signed-off-by: Vitor Mattos <[email protected]>
  • Loading branch information
vitormattos committed Mar 13, 2023
1 parent 43dbc7d commit 442aba3
Showing 1 changed file with 2 additions and 26 deletions.
28 changes: 2 additions & 26 deletions lib/Search/ConversationSearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
);

Expand Down

0 comments on commit 442aba3

Please sign in to comment.