mirror of
https://github.com/nextcloud/server.git
synced 2026-06-14 19:20:35 -04:00
Merge pull request #5186 from nextcloud/backport-5126-email-change-spam
[stable12] Don't trigger activity when the email didn't change
This commit is contained in:
commit
d08a6c74ab
1 changed files with 6 additions and 0 deletions
|
|
@ -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…
Reference in a new issue