Use guest avatar if visibility settings are not set to public
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
parent
092a1fb90f
commit
3f9b88bf7f
|
@ -133,12 +133,13 @@ class AvatarController extends Controller {
|
|||
$scope = $account->getProperty(IAccountManager::PROPERTY_AVATAR)->getScope();
|
||||
|
||||
if ($scope !== IAccountManager::VISIBILITY_PUBLIC && $this->userId === null) {
|
||||
// Public avatar access is not allowed
|
||||
return new JSONResponse([], Http::STATUS_NOT_FOUND);
|
||||
// Public avatar access is not allowed, fallback to guest avatar
|
||||
$avatar = $this->avatarManager->getGuestAvatar($userId);
|
||||
} else {
|
||||
$avatar = $this->avatarManager->getAvatar($userId);
|
||||
}
|
||||
|
||||
try {
|
||||
$avatar = $this->avatarManager->getAvatar($userId);
|
||||
$avatarFile = $avatar->getFile($size);
|
||||
$resp = new FileDisplayResponse(
|
||||
$avatarFile,
|
||||
|
|
Loading…
Reference in New Issue