[Avatar] We definitely don't need an event to retrieve avatar urls

This commit is contained in:
2021-09-18 04:54:35 +01:00
parent 2bd19fa087
commit fda998e335
7 changed files with 25 additions and 39 deletions

View File

@@ -24,8 +24,8 @@ namespace App\Entity;
use App\Core\Cache;
use App\Core\DB\DB;
use App\Core\Entity;
use App\Core\Event;
use App\Core\VisibilityScope;
use Component\Avatar\Avatar;
use DateTimeInterface;
/**
@@ -220,11 +220,9 @@ class Note extends Entity
return Actor::getNicknameFromId($this->actor_id);
}
public function getAvatarUrl()
public function getActorAvatarUrl(string $size = 'full'): string
{
$url = null;
Event::handle('GetAvatarUrl', [$this->getActorId(), &$url]);
return $url;
return Avatar::getAvatarUrl($this->getActorId(), $size);
}
public static function getAllNotes(int $noteScope): array