summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2018-08-01 10:56:22 +0200
committerJoas Schilling <coding@schilljs.com>2018-08-01 10:56:22 +0200
commitdecd1961627986db094de4bf9b83589b9ccdb41e (patch)
treee8b5b830357c50d1bc2d3104322709bb97a76234 /core
parent3e0668e348a3935b76c915b8aa1e523caf8da921 (diff)
downloadnextcloud-server-decd1961627986db094de4bf9b83589b9ccdb41e.tar.gz
nextcloud-server-decd1961627986db094de4bf9b83589b9ccdb41e.zip
Make the info available if the avatar was uploaded or generated
Signed-off-by: Joas Schilling <coding@schilljs.com>
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);