Skip to content

Commit 3d50355

Browse files
committed
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>
1 parent 346cd01 commit 3d50355

1 file changed

Lines changed: 18 additions & 1 deletion

File tree

lib/Notification/Notifier.php

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -928,7 +928,24 @@ protected function parseChatMessage(INotification $notification, Room $room, Par
928928

929929
$notification->addParsedAction($action);
930930
} else {
931-
$notification = $this->addActionButton($notification, 'chat_view', $l->t('View chat'), false);
931+
$notification = $this->addActionButton($notification, 'chat_view', $l->t('View chat'));
932+
933+
$action = $notification->createAction();
934+
$action->setLabel('mark_read')
935+
->setParsedLabel($l->t('Mark as read'))
936+
->setLink(
937+
$this->url->linkToOCSRouteAbsolute(
938+
'spreed.Chat.setReadMarker',
939+
[
940+
'apiVersion' => 'v1',
941+
'token' => $room->getToken(),
942+
'lastReadMessage' => $message->getMessageId(),
943+
]
944+
),
945+
IAction::TYPE_POST
946+
);
947+
948+
$notification->addParsedAction($action);
932949
}
933950

934951
if (array_key_exists('user', $richSubjectParameters) && $richSubjectParameters['user'] === null) {

0 commit comments

Comments
 (0)