diff --git a/src/lib/moderatePost_wrapped.ts b/src/lib/moderatePost_wrapped.ts index d2a106995c..0ce01368af 100644 --- a/src/lib/moderatePost_wrapped.ts +++ b/src/lib/moderatePost_wrapped.ts @@ -1,9 +1,4 @@ -import {moderatePost} from '@atproto/api' - -// TODO -// do we think we'll need this again? -// if not we can ditch it! -// -prf +import {moderatePost, BSKY_LABELER_DID} from '@atproto/api' type ModeratePost = typeof moderatePost type Options = Parameters[1] @@ -12,5 +7,24 @@ export function moderatePost_wrapped( subject: Parameters[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[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' + } + } + } +}