Don't get the avatar when we don't operate anyway
Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
parent
ec4b1584fe
commit
38f8f7cbf4
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue