Compare commits

...

1 Commits

Author SHA1 Message Date
Julius Härtl 3f9b88bf7f
Use guest avatar if visibility settings are not set to public
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2020-01-14 16:24:18 +01:00
1 changed files with 4 additions and 3 deletions

View File

@ -133,12 +133,13 @@ class AvatarController extends Controller {
$scope = $account->getProperty(IAccountManager::PROPERTY_AVATAR)->getScope(); $scope = $account->getProperty(IAccountManager::PROPERTY_AVATAR)->getScope();
if ($scope !== IAccountManager::VISIBILITY_PUBLIC && $this->userId === null) { if ($scope !== IAccountManager::VISIBILITY_PUBLIC && $this->userId === null) {
// Public avatar access is not allowed // Public avatar access is not allowed, fallback to guest avatar
return new JSONResponse([], Http::STATUS_NOT_FOUND); $avatar = $this->avatarManager->getGuestAvatar($userId);
} else {
$avatar = $this->avatarManager->getAvatar($userId);
} }
try { try {
$avatar = $this->avatarManager->getAvatar($userId);
$avatarFile = $avatar->getFile($size); $avatarFile = $avatar->getFile($size);
$resp = new FileDisplayResponse( $resp = new FileDisplayResponse(
$avatarFile, $avatarFile,