parent
0407e93ef8
commit
0c9935f125
|
@ -3,6 +3,7 @@ import {
|
||||||
AppBskyEmbedExternal,
|
AppBskyEmbedExternal,
|
||||||
AppBskyEmbedRecord,
|
AppBskyEmbedRecord,
|
||||||
AppBskyEmbedRecordWithMedia,
|
AppBskyEmbedRecordWithMedia,
|
||||||
|
AppBskyRichtextFacet,
|
||||||
ComAtprotoRepoUploadBlob,
|
ComAtprotoRepoUploadBlob,
|
||||||
RichText,
|
RichText,
|
||||||
} from '@atproto/api'
|
} from '@atproto/api'
|
||||||
|
@ -83,6 +84,17 @@ export async function post(store: RootStoreModel, opts: PostOpts) {
|
||||||
opts.onStateChange?.('Processing...')
|
opts.onStateChange?.('Processing...')
|
||||||
await rt.detectFacets(store.agent)
|
await rt.detectFacets(store.agent)
|
||||||
|
|
||||||
|
// filter out any mention facets that didn't map to a user
|
||||||
|
rt.facets = rt.facets?.filter(facet => {
|
||||||
|
const mention = facet.features.find(feature =>
|
||||||
|
AppBskyRichtextFacet.isMention(feature),
|
||||||
|
)
|
||||||
|
if (mention && !mention.did) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
})
|
||||||
|
|
||||||
if (opts.quote) {
|
if (opts.quote) {
|
||||||
embed = {
|
embed = {
|
||||||
$type: 'app.bsky.embed.record',
|
$type: 'app.bsky.embed.record',
|
||||||
|
|
Loading…
Reference in New Issue