From 7881f8fd5356280dda1ed8a44927fe3e776425a3 Mon Sep 17 00:00:00 2001 From: Jared Pereira Date: Thu, 30 Oct 2025 17:21:39 -0400 Subject: [PATCH] publish notifications to db --- .../[rkey]/Interactions/Comments/commentAction.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/app/lish/[did]/[publication]/[rkey]/Interactions/Comments/commentAction.ts b/app/lish/[did]/[publication]/[rkey]/Interactions/Comments/commentAction.ts index 1df1c06e..2bf0b44a 100644 --- a/app/lish/[did]/[publication]/[rkey]/Interactions/Comments/commentAction.ts +++ b/app/lish/[did]/[publication]/[rkey]/Interactions/Comments/commentAction.ts @@ -65,6 +65,21 @@ export async function publishComment(args: { } as unknown as Json, }) .select(); + let notifications = [ + { + comment: uri.toString(), + identity: new AtUri(args.document).host, + reason: "reply-on-post", + }, + ]; + if (args.comment.replyTo) + notifications.push({ + comment: uri.toString(), + identity: new AtUri(args.comment.replyTo).host, + reason: "reply-to-comment", + }); + // SOMEDAY: move this out the action with inngest or workflows + await supabaseServerClient.from("notif_comments").insert(notifications); return { record: data?.[0].record as Json, -- 2.51.2