Browse Source

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

Signed-off-by: Joas Schilling <coding@schilljs.com>
tags/v13.0.0beta1
Joas Schilling 7 years ago
parent
commit
7ef6f065ca
No account linked to committer's email address
1 changed files with 6 additions and 0 deletions
  1. 6
    0
      settings/Hooks.php

+ 6
- 0
settings/Hooks.php 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')

Loading…
Cancel
Save