Merge pull request #5126 from nextcloud/setting-the-same-email-shouldnt-trigger-activity

Don't trigger activity when the email didn't change
This commit is contained in:
Lukas Reschke 2017-05-28 18:25:09 +01:00 committed by GitHub
commit caccb9ca9c
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')