diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2016-01-22 11:34:49 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2016-01-25 20:05:11 +0100 |
commit | f165ad8864e5bdb213bdeb06d96b66612cee4fef (patch) | |
tree | a2ca41f40852b39fa16c79ca074cd6a1ac617712 /lib/private/user | |
parent | fe08700b597b8c765716e92569d30524cfef9b84 (diff) | |
download | nextcloud-server-f165ad8864e5bdb213bdeb06d96b66612cee4fef.tar.gz nextcloud-server-f165ad8864e5bdb213bdeb06d96b66612cee4fef.zip |
Changing the avatar of the user emits the changeUser event which triggers update of the system addressbook
Diffstat (limited to 'lib/private/user')
-rw-r--r-- | lib/private/user/user.php | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/private/user/user.php b/lib/private/user/user.php index 5b8bb6947a5..e8ce6b8cc87 100644 --- a/lib/private/user/user.php +++ b/lib/private/user/user.php @@ -140,9 +140,7 @@ class User implements IUser { $result = $this->backend->setDisplayName($this->uid, $displayName); if ($result) { $this->displayName = $displayName; - if ($this->emitter) { - $this->emitter->emit('\OC\User', 'changeUser', array($this)); - } + $this->triggerChange(); } return $result !== false; } else { @@ -163,9 +161,7 @@ class User implements IUser { } else { $this->config->setUserValue($this->uid, 'settings', 'email', $mailAddress); } - if ($this->emitter) { - $this->emitter->emit('\OC\User', 'changeUser', array($this)); - } + $this->triggerChange(); } /** @@ -389,4 +385,10 @@ class User implements IUser { return $url; } + public function triggerChange() { + if ($this->emitter) { + $this->emitter->emit('\OC\User', 'changeUser', array($this)); + } + } + } |