diff options
author | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2017-06-01 12:23:46 +0300 |
---|---|---|
committer | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2017-06-01 12:50:09 +0300 |
commit | ee7c6e0db86bea5266e134534bfdc8d5ad368512 (patch) | |
tree | c968964071720f18c117bd4a4cea96bac12570c8 /lib/private | |
parent | 0b8deebb4f99bbc3813ffbdb629a4b4a7da5c463 (diff) |
emit changeUser only if there really was a change (quota, displayname)
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/User/User.php | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/private/User/User.php b/lib/private/User/User.php index 3cc6dc3b7ed..1458ec6f826 100644 --- a/lib/private/User/User.php +++ b/lib/private/User/User.php @@ -158,12 +158,15 @@ class User implements IUser { * @since 9.0.0 */ public function setEMailAddress($mailAddress) { + $oldMailAddress = $this->getEMailAddress(); if($mailAddress === '') { $this->config->deleteUserValue($this->uid, 'settings', 'email'); } else { $this->config->setUserValue($this->uid, 'settings', 'email', $mailAddress); } - $this->triggerChange('eMailAddress', $mailAddress); + if($oldMailAddress !== $mailAddress) { + $this->triggerChange('eMailAddress', $mailAddress, $oldMailAddress); + } } /** @@ -366,12 +369,15 @@ class User implements IUser { * @since 9.0.0 */ public function setQuota($quota) { + $oldQuota = $this->config->getUserValue($this->uid, 'files', 'quota', ''); if($quota !== 'none' and $quota !== 'default') { $quota = OC_Helper::computerFileSize($quota); $quota = OC_Helper::humanFileSize($quota); } $this->config->setUserValue($this->uid, 'files', 'quota', $quota); - $this->triggerChange('quota', $quota); + if($quota !== $oldQuota) { + $this->triggerChange('quota', $quota); + } } /** |