Fix: distinguish between post media and quotes with the moderation hider (#2075)
* Fix: distinguish between post media and quotes with the moderation hider * Type fixes
This commit is contained in:
+20
-1
@@ -1,4 +1,4 @@
|
||||
import {ModerationCause, ProfileModeration} from '@atproto/api'
|
||||
import {ModerationCause, ProfileModeration, PostModeration} from '@atproto/api'
|
||||
|
||||
export interface ModerationCauseDescription {
|
||||
name: string
|
||||
@@ -92,6 +92,25 @@ export function getProfileModerationCauses(
|
||||
}) as ModerationCause[]
|
||||
}
|
||||
|
||||
export function isPostMediaBlurred(
|
||||
decisions: PostModeration['decisions'],
|
||||
): boolean {
|
||||
return decisions.post.blurMedia
|
||||
}
|
||||
|
||||
export function isQuoteBlurred(
|
||||
decisions: PostModeration['decisions'],
|
||||
): boolean {
|
||||
return (
|
||||
decisions.quote?.blur ||
|
||||
decisions.quote?.blurMedia ||
|
||||
decisions.quote?.filter ||
|
||||
decisions.quotedAccount?.blur ||
|
||||
decisions.quotedAccount?.filter ||
|
||||
false
|
||||
)
|
||||
}
|
||||
|
||||
export function isCauseALabelOnUri(
|
||||
cause: ModerationCause | undefined,
|
||||
uri: string,
|
||||
|
||||
Reference in New Issue
Block a user