{{ actor_nickname }}
diff --git a/src/Entity/Actor.php b/src/Entity/Actor.php
index c908010bbd..eb1c253ed2 100644
--- a/src/Entity/Actor.php
+++ b/src/Entity/Actor.php
@@ -24,11 +24,11 @@ namespace App\Entity;
use App\Core\Cache;
use App\Core\DB\DB;
use App\Core\Entity;
-use App\Core\Event;
use App\Core\Router\Router;
use App\Core\UserRoles;
use App\Util\Exception\NicknameException;
use App\Util\Nickname;
+use Component\Avatar\Avatar;
use DateTimeInterface;
use Functional as F;
@@ -215,11 +215,9 @@ class Actor extends Entity
return DB::findOneBy('local_user', ['id' => $this->getId()]);
}
- public function getAvatarUrl()
+ public function getAvatarUrl(string $size = 'full')
{
- $url = null;
- Event::handle('GetAvatarUrl', [$this->getId(), &$url]);
- return $url;
+ return Avatar::getAvatarUrl($this->getId(), $size);
}
public static function getFromId(int $id): ?self
diff --git a/src/Entity/Note.php b/src/Entity/Note.php
index 50dc4f2c88..0aca368b64 100644
--- a/src/Entity/Note.php
+++ b/src/Entity/Note.php
@@ -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
diff --git a/templates/actor/view.html.twig b/templates/actor/view.html.twig
index 02bc6b373f..d220a5bf35 100644
--- a/templates/actor/view.html.twig
+++ b/templates/actor/view.html.twig
@@ -1,19 +1,17 @@
{% extends 'stdgrid.html.twig' %}
-{% set id = actor.id %}
-{% set nick = actor.nickname %}
+{% set id = actor.getId() %}
+{% set nickname = actor.getNickname() %}
-{# TODO: how to get avatar in here? Tags and rest of profile info? #}
-{% set avatar = actor.nickname %}
+{% set avatar = actor.getAvatarUrl() %}
-{% block title %}{{ nick }}'s profile{% endblock %}
+{% block title %}{{ nickname }}'s profile{% endblock %}
{% block body %}