diff options
author | Maxence Lange <maxence@artificial-owl.com> | 2020-10-13 16:51:56 -0100 |
---|---|---|
committer | Maxence Lange <maxence@artificial-owl.com> | 2020-10-13 16:51:56 -0100 |
commit | de67f15f6d38ac25fea690eb28e4f4c27fac36a8 (patch) | |
tree | 57b0377ecf1ce74eb843ba5c3b46fc5f10b95674 /lib | |
parent | b56d4fe24bc3d15a6f433aed500f348d7292c508 (diff) |
display avatar
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Model/ActivityPub/ACore.php | 6 | ||||
-rw-r--r-- | lib/Search/UnifiedSearchProvider.php | 5 |
2 files changed, 4 insertions, 7 deletions
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 ); } |