about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/state/lib/api.ts10
-rw-r--r--src/state/models/notifications-view.ts14
-rw-r--r--src/view/com/notifications/FeedItem.tsx2
3 files changed, 22 insertions, 4 deletions
diff --git a/src/state/lib/api.ts b/src/state/lib/api.ts
index f17d0337c..2b9412f3d 100644
--- a/src/state/lib/api.ts
+++ b/src/state/lib/api.ts
@@ -21,7 +21,7 @@ export function doPolyfill() {
 export async function post(
   store: RootStoreModel,
   text: string,
-  replyTo?: Post.PostRef,
+  replyTo?: Post.ReplyRef,
   knownHandles?: Set<string>,
 ) {
   let reply
@@ -43,6 +43,14 @@ export async function post(
     }
   }
   const entities = extractEntities(text, knownHandles)
+  if (entities) {
+    for (const ent of entities) {
+      if (ent.type === 'mention') {
+        const prof = await store.profiles.getProfile(ent.value)
+        ent.value = prof.data.did
+      }
+    }
+  }
   return await store.api.app.bsky.feed.post.create(
     {did: store.me.did || ''},
     {
diff --git a/src/state/models/notifications-view.ts b/src/state/models/notifications-view.ts
index f820c71b7..808b7dee4 100644
--- a/src/state/models/notifications-view.ts
+++ b/src/state/models/notifications-view.ts
@@ -81,6 +81,10 @@ export class NotificationsViewItemModel implements GroupedNotification {
     return this.reason === 'trend'
   }
 
+  get isMention() {
+    return this.reason === 'mention'
+  }
+
   get isReply() {
     return this.reason === 'reply'
   }
@@ -94,7 +98,13 @@ export class NotificationsViewItemModel implements GroupedNotification {
   }
 
   get needsAdditionalData() {
-    if (this.isUpvote || this.isRepost || this.isTrend || this.isReply) {
+    if (
+      this.isUpvote ||
+      this.isRepost ||
+      this.isTrend ||
+      this.isReply ||
+      this.isMention
+    ) {
       return !this.additionalPost
     }
     return false
@@ -124,7 +134,7 @@ export class NotificationsViewItemModel implements GroupedNotification {
       return
     }
     let postUri
-    if (this.isReply) {
+    if (this.isReply || this.isMention) {
       postUri = this.uri
     } else if (this.isUpvote || this.isRead || this.isTrend) {
       postUri = this.subjectUri
diff --git a/src/view/com/notifications/FeedItem.tsx b/src/view/com/notifications/FeedItem.tsx
index 166b1bf99..c36cc34b7 100644
--- a/src/view/com/notifications/FeedItem.tsx
+++ b/src/view/com/notifications/FeedItem.tsx
@@ -48,7 +48,7 @@ export const FeedItem = observer(function FeedItem({
     return <View />
   }
 
-  if (item.isReply) {
+  if (item.isReply || item.isMention) {
     return (
       <Link href={itemHref} title={itemTitle}>
         <Post