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) {