]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix(backupcodes): Remove old notifications before creating a new reminder 41452/head
authorJoas Schilling <coding@schilljs.com>
Tue, 14 Nov 2023 07:49:17 +0000 (08:49 +0100)
committerbackportbot-nextcloud[bot] <backportbot-nextcloud[bot]@users.noreply.github.com>
Tue, 14 Nov 2023 10:11:08 +0000 (10:11 +0000)
Signed-off-by: Joas Schilling <coding@schilljs.com>
apps/twofactor_backupcodes/lib/BackgroundJob/RememberBackupCodesJob.php

index 3eed1bb8dead621f54064d0c7d4083a6001fb05f..592d8dab00cbc8772ed1c54cd2fa9a4a836fa0fc 100644 (file)
@@ -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);
        }
 }