From bfa7a37d4ca44a1f226e5e99b7b5f68ae8003ed3 Mon Sep 17 00:00:00 2001 From: Cristian Scheid Date: Fri, 9 Oct 2026 09:45:49 -0300 Subject: [PATCH] fix(notifications): dismiss join request notification once processed Signed-off-by: Cristian Scheid --- lib/Notification/Notifier.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/Notification/Notifier.php b/lib/Notification/Notifier.php index 0f24a4ef5..6e9ed9366 100644 --- a/lib/Notification/Notifier.php +++ b/lib/Notification/Notifier.php @@ -18,6 +18,7 @@ use OCA\Circles\Exceptions\MemberNotFoundException; use OCA\Circles\Exceptions\RequestBuilderException; use OCA\Circles\Exceptions\SingleCircleNotFoundException; +use OCA\Circles\Model\Member; use OCA\Circles\Model\Probes\CircleProbe; use OCA\Circles\Service\ConfigService; use OCA\Circles\Service\FederatedUserService; @@ -131,6 +132,7 @@ public function prepare(INotification $notification, string $languageCode): INot * @throws InvalidIdException * @throws SingleCircleNotFoundException * @throws UnknownNotificationException + * @throws AlreadyProcessedException */ private function prepareMemberNotification(INotification $notification) { $this->federatedUserService->initCurrentUser($notification->getUser()); @@ -145,6 +147,10 @@ private function prepareMemberNotification(INotification $notification) { $probe ); + if ($notification->getSubject() === 'joinRequest' && $member->getStatus() !== Member::STATUS_REQUEST) { + throw new AlreadyProcessedException(); + } + $subject = match ($notification->getSubject()) { 'memberAdd' => $this->l10n->t( 'You are now a member of the Team "%2$s"',