From 0898eb3a91d5158ec894e0bd5ef9786288efc6f1 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 14 Nov 2023 08:49:17 +0100 Subject: [PATCH] fix(backupcodes): Remove old notifications before creating a new reminder Signed-off-by: Joas Schilling --- .../lib/BackgroundJob/RememberBackupCodesJob.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/twofactor_backupcodes/lib/BackgroundJob/RememberBackupCodesJob.php b/apps/twofactor_backupcodes/lib/BackgroundJob/RememberBackupCodesJob.php index 3eed1bb8dead6..592d8dab00cbc 100644 --- a/apps/twofactor_backupcodes/lib/BackgroundJob/RememberBackupCodesJob.php +++ b/apps/twofactor_backupcodes/lib/BackgroundJob/RememberBackupCodesJob.php @@ -94,9 +94,11 @@ protected function run($argument) { $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); } }