]> source.dussan.org Git - nextcloud-server.git/commitdiff
Don't get the avatar when we don't operate anyway
authorJoas Schilling <coding@schilljs.com>
Tue, 9 Apr 2019 09:23:06 +0000 (11:23 +0200)
committerJoas Schilling <coding@schilljs.com>
Tue, 9 Apr 2019 09:23:06 +0000 (11:23 +0200)
Signed-off-by: Joas Schilling <coding@schilljs.com>
lib/private/Avatar/UserAvatar.php
lib/private/Server.php

index db5e041d66c670f33b59896b15894ac1ea4d8442..2db65634e8c3af389ef05fac856e5cdcfe7c126f 100644 (file)
@@ -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;
index 6507f58f8964858a166375deb51757ea712cd0b3..936ce21fa6203d92b7949e994122d0a27fac76f5 100644 (file)
@@ -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);