From: Joas Schilling Date: Tue, 14 Nov 2023 07:49:17 +0000 (+0100) Subject: fix(backupcodes): Remove old notifications before creating a new reminder X-Git-Tag: v26.0.9rc1~15^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=refs%2Fpull%2F41452%2Fhead;p=nextcloud-server.git fix(backupcodes): Remove old notifications before creating a new reminder Signed-off-by: Joas Schilling --- 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); } }