aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2018-08-01 22:54:38 +0200
committerGitHub <noreply@github.com>2018-08-01 22:54:38 +0200
commitfae7e516b5e17ae95e850a866c9e5a08732e2f6b (patch)
tree3234679e25c38ef05f9a88d8368fe03287b4066c /core
parentb5c5faebfc136d634fd7e80d6a0a8e1094bca717 (diff)
parent38fffffe18dc705f29bbb477aebd8497f173d37a (diff)
downloadnextcloud-server-fae7e516b5e17ae95e850a866c9e5a08732e2f6b.tar.gz
nextcloud-server-fae7e516b5e17ae95e850a866c9e5a08732e2f6b.zip
Merge pull request #10481 from nextcloud/feature/noid/make-info-available-if-the-avatar-was-uploaded
Make the info available if the avatar was uploaded or generated
Diffstat (limited to 'core')
-rw-r--r--core/Controller/AvatarController.php11
1 files changed, 6 insertions, 5 deletions
diff --git a/core/Controller/AvatarController.php b/core/Controller/AvatarController.php
index 0625265dd05..03efe4d1e52 100644
--- a/core/Controller/AvatarController.php
+++ b/core/Controller/AvatarController.php
@@ -132,12 +132,13 @@ class AvatarController extends Controller {
}
try {
- $avatar = $this->avatarManager->getAvatar($userId)->getFile($size);
+ $avatar = $this->avatarManager->getAvatar($userId);
+ $avatarFile = $avatar->getFile($size);
$resp = new FileDisplayResponse(
- $avatar,
- Http::STATUS_OK,
- ['Content-Type' => $avatar->getMimeType()
- ]);
+ $avatarFile,
+ $avatar->isCustomAvatar() ? Http::STATUS_OK : Http::STATUS_CREATED,
+ ['Content-Type' => $avatarFile->getMimeType()]
+ );
} catch (\Exception $e) {
$resp = new Http\Response();
$resp->setStatus(Http::STATUS_NOT_FOUND);