[COMPONENT][Avatar][Controller] Implement multiple dimensions

This commit is contained in:
2021-12-27 04:47:04 +00:00
parent 2a902d6a7e
commit de148c1f78
5 changed files with 29 additions and 21 deletions

View File

@@ -57,13 +57,8 @@ class Avatar extends Controller
*/
public function avatar_view(Request $request, int $actor_id, string $size): Response
{
switch ($size) {
case 'full':
$res = \Component\Avatar\Avatar::getAvatarFileInfo($actor_id);
return M::sendFile($res['filepath'], $res['mimetype'], $res['title']);
default:
throw new Exception('Not implemented');
}
$res = \Component\Avatar\Avatar::getAvatarFileInfo($actor_id, $size);
return M::sendFile($res['filepath'], $res['mimetype'], $res['title']);
}
/**