Merge pull request #41447 from nextcloud/bugfix/noid/dont-spam-users-with-reminders

fix(backupcodes): Remove old notifications before creating a new remi…
pull/41454/head
Joas Schilling 2023-11-14 10:41:45 +07:00 committed by GitHub
commit be76f0d088
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

@ -94,9 +94,11 @@ class RememberBackupCodesJob extends TimedJob {
$notification = $this->notificationManager->createNotification();
$notification->setApp('twofactor_backupcodes')
->setUser($user->getUID())
->setDateTime($date)
->setObject('create', 'codes')
->setSubject('create_backupcodes');
$this->notificationManager->markProcessed($notification);
$notification->setDateTime($date);
$this->notificationManager->notify($notification);
}
}