From 3d5035550159e051fc47050172f0163eed189b97 Mon Sep 17 00:00:00 2001 From: "Jan C. Borchardt" <925062+jancborchardt@users.noreply.github.com> Date: Wed, 22 Jul 2026 11:59:18 +0200 Subject: [PATCH] feat(notifications): add "Mark as read" action to chat notifications, fix #6035 Assisted-by: ClaudeCode:claude-opus-4-8 Signed-off-by: Jan C. Borchardt <925062+jancborchardt@users.noreply.github.com> --- lib/Notification/Notifier.php | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/lib/Notification/Notifier.php b/lib/Notification/Notifier.php index be5c91fed38..322ee98ce40 100644 --- a/lib/Notification/Notifier.php +++ b/lib/Notification/Notifier.php @@ -928,7 +928,24 @@ protected function parseChatMessage(INotification $notification, Room $room, Par $notification->addParsedAction($action); } else { - $notification = $this->addActionButton($notification, 'chat_view', $l->t('View chat'), false); + $notification = $this->addActionButton($notification, 'chat_view', $l->t('View chat')); + + $action = $notification->createAction(); + $action->setLabel('mark_read') + ->setParsedLabel($l->t('Mark as read')) + ->setLink( + $this->url->linkToOCSRouteAbsolute( + 'spreed.Chat.setReadMarker', + [ + 'apiVersion' => 'v1', + 'token' => $room->getToken(), + 'lastReadMessage' => $message->getMessageId(), + ] + ), + IAction::TYPE_POST + ); + + $notification->addParsedAction($action); } if (array_key_exists('user', $richSubjectParameters) && $richSubjectParameters['user'] === null) {