diff options
Diffstat (limited to 'src/state/lib/api.ts')
-rw-r--r-- | src/state/lib/api.ts | 10 |
1 files changed, 9 insertions, 1 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 || ''}, { |