diff options
author | Joas Schilling <coding@schilljs.com> | 2019-04-09 11:23:06 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2019-04-09 11:23:06 +0200 |
commit | 38f8f7cbf4dbfecdb55be8bfcafa4d8b5c7355d4 (patch) | |
tree | 7acb908ad5f4d5ffd331b7d500e1b696fa1a631b /lib | |
parent | ec4b1584fe46df81e3eda1ff374f575d153a966f (diff) | |
download | nextcloud-server-38f8f7cbf4dbfecdb55be8bfcafa4d8b5c7355d4.tar.gz nextcloud-server-38f8f7cbf4dbfecdb55be8bfcafa4d8b5c7355d4.zip |
Don't get the avatar when we don't operate anyway
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Avatar/UserAvatar.php | 5 | ||||
-rw-r--r-- | lib/private/Server.php | 5 |
2 files changed, 5 insertions, 5 deletions
diff --git a/lib/private/Avatar/UserAvatar.php b/lib/private/Avatar/UserAvatar.php index db5e041d66c..2db65634e8c 100644 --- a/lib/private/Avatar/UserAvatar.php +++ b/lib/private/Avatar/UserAvatar.php @@ -312,11 +312,6 @@ class UserAvatar extends Avatar { * @throws \OCP\PreConditionNotMetException */ public function userChanged($feature, $oldValue, $newValue) { - // We only change the avatar on display name changes - if ($feature !== 'displayName') { - return; - } - // If the avatar is not generated (so an uploaded image) we skip this if (!$this->folder->fileExists('generated')) { return; diff --git a/lib/private/Server.php b/lib/private/Server.php index 6507f58f896..936ce21fa62 100644 --- a/lib/private/Server.php +++ b/lib/private/Server.php @@ -1257,6 +1257,11 @@ class Server extends ServerContainer implements IServerContainer { $oldValue = $e->getArgument('oldValue'); $value = $e->getArgument('value'); + // We only change the avatar on display name changes + if ($feature !== 'displayName') { + return; + } + try { $avatar = $manager->getAvatar($user->getUID()); $avatar->userChanged($feature, $oldValue, $value); |