Skip to content

Commit

Permalink
Update avatars on update
Browse files Browse the repository at this point in the history
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
  • Loading branch information
CarlSchwan committed Sep 8, 2022
1 parent f4df52a commit 35813f1
Show file tree
Hide file tree
Showing 11 changed files with 11,652 additions and 24 deletions.
2 changes: 1 addition & 1 deletion core/Controller/AvatarController.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public function getAvatarDark(string $userId, int $size) {
*
* @return JSONResponse|FileDisplayResponse
*/
public function getAvatar(string $userId, int $size, bool $darkTheme = false) {
public function getAvatar(string $userId, int $size) {
if ($size <= 64) {
if ($size !== 64) {
$this->logger->debug('Avatar requested in deprecated size ' . $size);
Expand Down
6 changes: 3 additions & 3 deletions core/Controller/GuestAvatarController.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ public function __construct(
* @param string $size The desired avatar size, e.g. 64 for 64x64px
* @return FileDisplayResponse|Http\Response
*/
public function getAvatar(string $guestName, string $size, ?bool $dark = false) {
public function getAvatar(string $guestName, string $size, ?bool $darkTheme = false) {
$size = (int) $size;
$dark = $dark === null ? false : $dark;
$darkTheme = $darkTheme ?? false;

if ($size <= 64) {
if ($size !== 64) {
Expand All @@ -78,7 +78,7 @@ public function getAvatar(string $guestName, string $size, ?bool $dark = false)

try {
$avatar = $this->avatarManager->getGuestAvatar($guestName);
$avatarFile = $avatar->getFile($size);
$avatarFile = $avatar->getFile($size, $darkTheme);

$resp = new FileDisplayResponse(
$avatarFile,
Expand Down
Loading

0 comments on commit 35813f1

Please sign in to comment.