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
parent
commit
38f8f7cbf4
No known key found for this signature in database GPG Key ID: 7076EA9751AACDDA
  1. 5
      lib/private/Avatar/UserAvatar.php
  2. 5
      lib/private/Server.php

5
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;

5
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);

Loading…
Cancel
Save