Filter hideable content from notifications

This commit is contained in:
Eric Bailey
2024-09-06 13:08:20 -05:00
parent f8772fc59a
commit 310c121649
3 changed files with 15 additions and 4 deletions
+8 -2
View File
@@ -33,14 +33,20 @@ export function isJustAMute(modui: ModerationUI): boolean {
return modui.filters.length === 1 && modui.filters[0].type === 'muted'
}
export function isImperative(modui: ModerationUI): boolean {
export function moduiContainsHideableOffense(modui: ModerationUI): boolean {
const label = modui.filters.at(0)
if (label && label.type === 'label') {
return ['!hide', '!takedown'].includes(label.label.val)
return labelIsHideableOffense(label.label)
}
return false
}
export function labelIsHideableOffense(
label: ComAtprotoLabelDefs.Label,
): boolean {
return ['!hide', '!takedown'].includes(label.val)
}
export function getLabelingServiceTitle({
displayName,
handle,