Remove moderatePost_wrapped (#7188)

* rm `moderatePost_wrapped`

* Handle display in app

---------

Co-authored-by: Eric Bailey <git@esb.lol>
This commit is contained in:
Samuel Newman
2025-02-25 09:21:00 -08:00
committed by GitHub
parent cc8369e868
commit 0d1373bb71
14 changed files with 19 additions and 55 deletions
-31
View File
@@ -1,31 +0,0 @@
/* eslint-disable-next-line no-restricted-imports */
import {BSKY_LABELER_DID, moderatePost} from '@atproto/api'
type ModeratePost = typeof moderatePost
type Options = Parameters<ModeratePost>[1]
export function moderatePost_wrapped(
subject: Parameters<ModeratePost>[0],
opts: Options,
) {
// HACK
// temporarily translate 'gore' into 'graphic-media' during the transition period
// can remove this in a few months
// -prf
translateOldLabels(subject)
return moderatePost(subject, opts)
}
function translateOldLabels(subject: Parameters<ModeratePost>[0]) {
if (subject.labels) {
for (const label of subject.labels) {
if (
label.val === 'gore' &&
(!label.src || label.src === BSKY_LABELER_DID)
) {
label.val = 'graphic-media'
}
}
}
}
@@ -46,6 +46,10 @@ export function useGlobalLabelStrings(): GlobalLabelStrings {
name: _(msg`Graphic Media`),
description: _(msg`Explicit or potentially disturbing media.`),
},
gore: {
name: _(msg`Graphic Media`),
description: _(msg`Explicit or potentially disturbing media.`),
},
}),
[_],
)