Don't trigger activity when the email didn't change

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2017-05-26 12:49:12 +02:00
parent 99117349df
commit ea9613efa0
No known key found for this signature in database
GPG Key ID: E166FD8976B3BAC8
1 changed files with 6 additions and 0 deletions

View File

@ -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')