From ae522c86fe41c1449fe28972eeb45be6074ef227 Mon Sep 17 00:00:00 2001 From: Paul Frazee Date: Tue, 6 Dec 2022 13:47:52 -0600 Subject: Fix mention-creation and implement mentions in notifications --- src/state/lib/api.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/state/lib/api.ts') 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, ) { 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 || ''}, { -- cgit 1.4.1