summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMaxence Lange <maxence@artificial-owl.com>2020-10-13 16:51:56 -0100
committerMaxence Lange <maxence@artificial-owl.com>2020-10-13 16:51:56 -0100
commitde67f15f6d38ac25fea690eb28e4f4c27fac36a8 (patch)
tree57b0377ecf1ce74eb843ba5c3b46fc5f10b95674 /lib
parentb56d4fe24bc3d15a6f433aed500f348d7292c508 (diff)
display avatar
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/Model/ActivityPub/ACore.php6
-rw-r--r--lib/Search/UnifiedSearchProvider.php5
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
);
}