Browse Source
Don't get the avatar when we don't operate anyway
Signed-off-by: Joas Schilling <coding@schilljs.com>
pull/15020/head
Joas Schilling
7 years ago
No known key found for this signature in database
GPG Key ID: 7076EA9751AACDDA
2 changed files with
5 additions and
5 deletions
-
lib/private/Avatar/UserAvatar.php
-
lib/private/Server.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; |
|
|
|
|
|
|
|
@ -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); |
|
|
|
|