From d0bd69a46475b53fd8dd3084fe5dd3889606b82e 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 3eed1bb8dea..592d8dab00c 100644 --- a/apps/twofactor_backupcodes/lib/BackgroundJob/RememberBackupCodesJob.php +++ b/apps/twofactor_backupcodes/lib/BackgroundJob/RememberBackupCodesJob.php @@ -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); } } -- 2.39.5