summaryrefslogtreecommitdiffstats
path: root/settings/Hooks.php
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2017-05-26 12:49:12 +0200
committerJoas Schilling <coding@schilljs.com>2017-05-26 12:49:12 +0200
commit7ef6f065ca3dd05ffea46c7fe039938e6ace43e1 (patch)
treeaffcc8a6efee1653c7a7b003edd5ca66f15f558d /settings/Hooks.php
parentc1925ddfd03c6e12874137fb1ba497aad8fc0c41 (diff)
downloadnextcloud-server-7ef6f065ca3dd05ffea46c7fe039938e6ace43e1.tar.gz
nextcloud-server-7ef6f065ca3dd05ffea46c7fe039938e6ace43e1.zip
Don't trigger activity when the email didn't change
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'settings/Hooks.php')
-rw-r--r--settings/Hooks.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/settings/Hooks.php b/settings/Hooks.php
index 2d8b17ebfd9..9addaea5a91 100644
--- a/settings/Hooks.php
+++ b/settings/Hooks.php
@@ -117,6 +117,12 @@ class Hooks {
* @throws \BadMethodCallException
*/
public function onChangeEmail(IUser $user, $oldMailAddress) {
+
+ if ($oldMailAddress === $user->getEMailAddress()) {
+ // Email didn't really change, so don't create activities and emails
+ return;
+ }
+
$event = $this->activityManager->generateEvent();
$event->setApp('settings')
->setType('personal_settings')