From 7ef6f065ca3dd05ffea46c7fe039938e6ace43e1 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 26 May 2017 12:49:12 +0200 Subject: [PATCH] Don't trigger activity when the email didn't change Signed-off-by: Joas Schilling --- settings/Hooks.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/settings/Hooks.php b/settings/Hooks.php index 2d8b17ebfd..9addaea5a9 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')