Improved mute alerting (#1355)
* Use a simpler mute alert when viewing a post by a muted user * Dont mute self-QPs when we're overriding a mute * Fix types
This commit is contained in:
parent
3e96373903
commit
419ac2d0df
4 changed files with 63 additions and 6 deletions
24
src/lib/embeds.ts
Normal file
24
src/lib/embeds.ts
Normal file
|
@ -0,0 +1,24 @@
|
|||
import {
|
||||
AppBskyFeedDefs,
|
||||
AppBskyEmbedRecord,
|
||||
AppBskyEmbedRecordWithMedia,
|
||||
} from '@atproto/api'
|
||||
|
||||
export function isEmbedByEmbedder(
|
||||
embed: AppBskyFeedDefs.PostView['embed'],
|
||||
did: string,
|
||||
): boolean {
|
||||
if (!embed) {
|
||||
return false
|
||||
}
|
||||
if (AppBskyEmbedRecord.isViewRecord(embed.record)) {
|
||||
return embed.record.author.did === did
|
||||
}
|
||||
if (
|
||||
AppBskyEmbedRecordWithMedia.isView(embed) &&
|
||||
AppBskyEmbedRecord.isViewRecord(embed.record.record)
|
||||
) {
|
||||
return embed.record.record.author.did === did
|
||||
}
|
||||
return true
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue