diff --git a/lib/Model/ActivityPub/ACore.php b/lib/Model/ActivityPub/ACore.php index 6609000d..ee8bfcb7 100644 --- a/lib/Model/ActivityPub/ACore.php +++ b/lib/Model/ActivityPub/ACore.php @@ -210,11 +210,7 @@ class ACore extends Item implements JsonSerializable { * @return bool */ public function hasIcon(): bool { - if ($this->icon === null) { - return false; - } - - return true; + return ($this->icon !== null); } /** diff --git a/lib/Search/UnifiedSearchProvider.php b/lib/Search/UnifiedSearchProvider.php index 007d3c11..9ef522cc 100644 --- a/lib/Search/UnifiedSearchProvider.php +++ b/lib/Search/UnifiedSearchProvider.php @@ -217,12 +217,13 @@ class UnifiedSearchProvider implements IProvider { private function convertAccounts(array $accounts): array { $result = []; foreach ($accounts as $account) { + $icon = ($account->hasIcon()) ? $account->getIcon()->getUrl() : ''; $result[] = new UnifiedSearchResult( - $account->getAvatar(), + $icon, $account->getPreferredUsername(), '@' . $account->getAccount(), $account->getUrl(), - $account->getAvatar() + $icon ); }