Signed-off-by: Joas Schilling <coding@schilljs.com>
* @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;
$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);