|
|
|
@ -36,7 +36,7 @@ class GuestAvatarController extends Controller { |
|
|
|
|
* Returns a guest avatar image response |
|
|
|
|
* |
|
|
|
|
* @param string $guestName The guest name, e.g. "Albert" |
|
|
|
|
* @param string $size The desired avatar size, e.g. 64 for 64x64px |
|
|
|
|
* @param 64|512 $size The desired avatar size, e.g. 64 for 64x64px |
|
|
|
|
* @param bool|null $darkTheme Return dark avatar |
|
|
|
|
* @return FileDisplayResponse<Http::STATUS_OK|Http::STATUS_CREATED, array{Content-Type: string, X-NC-IsCustomAvatar: int}>|Response<Http::STATUS_INTERNAL_SERVER_ERROR, array{}> |
|
|
|
|
* |
|
|
|
@ -46,8 +46,7 @@ class GuestAvatarController extends Controller { |
|
|
|
|
#[PublicPage] |
|
|
|
|
#[NoCSRFRequired] |
|
|
|
|
#[FrontpageRoute(verb: 'GET', url: '/avatar/guest/{guestName}/{size}')] |
|
|
|
|
public function getAvatar(string $guestName, string $size, ?bool $darkTheme = false) { |
|
|
|
|
$size = (int) $size; |
|
|
|
|
public function getAvatar(string $guestName, int $size, ?bool $darkTheme = false) { |
|
|
|
|
$darkTheme = $darkTheme ?? false; |
|
|
|
|
|
|
|
|
|
if ($size <= 64) { |
|
|
|
@ -89,7 +88,7 @@ class GuestAvatarController extends Controller { |
|
|
|
|
* Returns a dark guest avatar image response |
|
|
|
|
* |
|
|
|
|
* @param string $guestName The guest name, e.g. "Albert" |
|
|
|
|
* @param string $size The desired avatar size, e.g. 64 for 64x64px |
|
|
|
|
* @param 64|512 $size The desired avatar size, e.g. 64 for 64x64px |
|
|
|
|
* @return FileDisplayResponse<Http::STATUS_OK|Http::STATUS_CREATED, array{Content-Type: string, X-NC-IsCustomAvatar: int}>|Response<Http::STATUS_INTERNAL_SERVER_ERROR, array{}> |
|
|
|
|
* |
|
|
|
|
* 200: Custom avatar returned |
|
|
|
@ -98,7 +97,7 @@ class GuestAvatarController extends Controller { |
|
|
|
|
#[PublicPage] |
|
|
|
|
#[NoCSRFRequired] |
|
|
|
|
#[FrontpageRoute(verb: 'GET', url: '/avatar/guest/{guestName}/{size}/dark')] |
|
|
|
|
public function getAvatarDark(string $guestName, string $size) { |
|
|
|
|
public function getAvatarDark(string $guestName, int $size) { |
|
|
|
|
return $this->getAvatar($guestName, $size, true); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|