- ...llo this is the content of a post or whatever here it comes{" "}
-
@celine and here it
- was! ooooh heck yeah the high is unre...
+
+
}
diff --git a/app/(home-pages)/notifications/NotificationList.tsx b/app/(home-pages)/notifications/NotificationList.tsx
index 9cee7bba..74f085a0 100644
--- a/app/(home-pages)/notifications/NotificationList.tsx
+++ b/app/(home-pages)/notifications/NotificationList.tsx
@@ -7,6 +7,7 @@ import { markAsRead } from "./getNotifications";
import { ReplyNotification } from "./ReplyNotification";
import { useIdentityData } from "components/IdentityProvider";
import { FollowNotification } from "./FollowNotification";
+import { QuoteNotification } from "./MentionNotification";
export function NotificationList({
notifications,
@@ -42,6 +43,9 @@ export function NotificationList({
if (n.type === "subscribe") {
return
;
}
+ if (n.type === "quote") {
+ return
;
+ }
})}
diff --git a/app/api/inngest/functions/index_post_mention.ts b/app/api/inngest/functions/index_post_mention.ts
index 06150cb0..73edfbe2 100644
--- a/app/api/inngest/functions/index_post_mention.ts
+++ b/app/api/inngest/functions/index_post_mention.ts
@@ -3,6 +3,8 @@ import { inngest } from "../client";
import { AtpAgent, AtUri } from "@atproto/api";
import { Json } from "supabase/database.types";
import { ids } from "lexicons/api/lexicons";
+import { Notification, pingIdentityToUpdateNotification } from "src/notifications";
+import { v7 } from "uuid";
export const index_post_mention = inngest.createFunction(
{ id: "index_post_mention" },
@@ -37,6 +39,12 @@ export const index_post_mention = inngest.createFunction(
return { message: `No post found for ${event.data.post_uri}` };
}
+ const documentUri = AtUri.make(
+ pub.identity_did,
+ ids.PubLeafletDocument,
+ path[0],
+ ).toString();
+
await step.run("index-bsky-post", async () => {
await supabaseServerClient.from("bsky_posts").insert({
uri: bsky_post.uri,
@@ -45,13 +53,26 @@ export const index_post_mention = inngest.createFunction(
});
await supabaseServerClient.from("document_mentions_in_bsky").insert({
uri: bsky_post.uri,
- document: AtUri.make(
- pub.identity_did,
- ids.PubLeafletDocument,
- path[0],
- ).toString(),
+ document: documentUri,
link: event.data.document_link,
});
});
+
+ await step.run("create-notification", async () => {
+ // Only create notification if the quote is from someone other than the author
+ if (bsky_post.author.did !== pub.identity_did) {
+ const notification: Notification = {
+ id: v7(),
+ recipient: pub.identity_did,
+ data: {
+ type: "quote",
+ bsky_post_uri: bsky_post.uri,
+ document_uri: documentUri,
+ },
+ };
+ await supabaseServerClient.from("notifications").insert(notification);
+ await pingIdentityToUpdateNotification(pub.identity_did);
+ }
+ });
},
);
diff --git a/src/notifications.ts b/src/notifications.ts
index 4b6301d6..cc6acab0 100644
--- a/src/notifications.ts
+++ b/src/notifications.ts
@@ -11,22 +11,25 @@ export type Notification = Omit