mirror of https://git.lenooby09.tech/LeNooby09/social-app.git
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

at session/base 30 lines 754 B view raw
1import {moderatePost, BSKY_LABELER_DID} from '@atproto/api' 2 3type ModeratePost = typeof moderatePost 4type Options = Parameters<ModeratePost>[1] 5 6export function moderatePost_wrapped( 7 subject: Parameters<ModeratePost>[0], 8 opts: Options, 9) { 10 // HACK 11 // temporarily translate 'gore' into 'graphic-media' during the transition period 12 // can remove this in a few months 13 // -prf 14 translateOldLabels(subject) 15 16 return moderatePost(subject, opts) 17} 18 19function translateOldLabels(subject: Parameters<ModeratePost>[0]) { 20 if (subject.labels) { 21 for (const label of subject.labels) { 22 if ( 23 label.val === 'gore' && 24 (!label.src || label.src === BSKY_LABELER_DID) 25 ) { 26 label.val = 'graphic-media' 27 } 28 } 29 } 30}