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();
|
$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,
|
||||||
|
|
Loading…
Reference in New Issue