Bluesky app fork with some witchin' additions 馃挮
at main 123 lines 5.7 kB view raw
1import { 2 ComAtprotoModerationDefs as RootReportDefs, 3 ToolsOzoneReportDefs as OzoneReportDefs, 4} from '@atproto/api' 5 6import {type ParsedReportSubject} from '#/components/moderation/ReportDialog/types' 7 8export const DMCA_LINK = 'https://bsky.social/about/support/copyright' 9export const SUPPORT_PAGE = 'https://bsky.social/about/support' 10 11export const NEW_TO_OLD_REASON_MAPPING: Record<string, string> = {} 12 13/** 14 * Mapping of new (Ozone namespace) reason types to old reason types. 15 * 16 * Matches the mapping defined in the Ozone codebase: 17 * @see https://github.com/bluesky-social/atproto/blob/4c15fb47cec26060bff2e710e95869a90c9d7fdd/packages/ozone/src/mod-service/profile.ts#L16-L64 18 */ 19export const NEW_TO_OLD_REASONS_MAP: Record< 20 OzoneReportDefs.ReasonType, 21 RootReportDefs.ReasonType 22> = { 23 [OzoneReportDefs.REASONAPPEAL]: RootReportDefs.REASONAPPEAL, 24 [OzoneReportDefs.REASONOTHER]: RootReportDefs.REASONOTHER, 25 26 [OzoneReportDefs.REASONVIOLENCEANIMAL]: RootReportDefs.REASONVIOLATION, 27 [OzoneReportDefs.REASONVIOLENCETHREATS]: RootReportDefs.REASONVIOLATION, 28 [OzoneReportDefs.REASONVIOLENCEGRAPHICCONTENT]: 29 RootReportDefs.REASONVIOLATION, 30 [OzoneReportDefs.REASONVIOLENCEGLORIFICATION]: RootReportDefs.REASONVIOLATION, 31 [OzoneReportDefs.REASONVIOLENCEEXTREMISTCONTENT]: 32 RootReportDefs.REASONVIOLATION, 33 [OzoneReportDefs.REASONVIOLENCETRAFFICKING]: RootReportDefs.REASONVIOLATION, 34 [OzoneReportDefs.REASONVIOLENCEOTHER]: RootReportDefs.REASONVIOLATION, 35 36 [OzoneReportDefs.REASONSEXUALABUSECONTENT]: RootReportDefs.REASONSEXUAL, 37 [OzoneReportDefs.REASONSEXUALNCII]: RootReportDefs.REASONSEXUAL, 38 [OzoneReportDefs.REASONSEXUALDEEPFAKE]: RootReportDefs.REASONSEXUAL, 39 [OzoneReportDefs.REASONSEXUALANIMAL]: RootReportDefs.REASONSEXUAL, 40 [OzoneReportDefs.REASONSEXUALUNLABELED]: RootReportDefs.REASONSEXUAL, 41 [OzoneReportDefs.REASONSEXUALOTHER]: RootReportDefs.REASONSEXUAL, 42 43 [OzoneReportDefs.REASONCHILDSAFETYCSAM]: RootReportDefs.REASONVIOLATION, 44 [OzoneReportDefs.REASONCHILDSAFETYGROOM]: RootReportDefs.REASONVIOLATION, 45 [OzoneReportDefs.REASONCHILDSAFETYPRIVACY]: RootReportDefs.REASONVIOLATION, 46 [OzoneReportDefs.REASONCHILDSAFETYHARASSMENT]: RootReportDefs.REASONVIOLATION, 47 [OzoneReportDefs.REASONCHILDSAFETYOTHER]: RootReportDefs.REASONVIOLATION, 48 49 [OzoneReportDefs.REASONHARASSMENTTROLL]: RootReportDefs.REASONRUDE, 50 [OzoneReportDefs.REASONHARASSMENTTARGETED]: RootReportDefs.REASONRUDE, 51 [OzoneReportDefs.REASONHARASSMENTHATESPEECH]: RootReportDefs.REASONRUDE, 52 [OzoneReportDefs.REASONHARASSMENTDOXXING]: RootReportDefs.REASONRUDE, 53 [OzoneReportDefs.REASONHARASSMENTOTHER]: RootReportDefs.REASONRUDE, 54 55 [OzoneReportDefs.REASONMISLEADINGBOT]: RootReportDefs.REASONMISLEADING, 56 [OzoneReportDefs.REASONMISLEADINGIMPERSONATION]: 57 RootReportDefs.REASONMISLEADING, 58 [OzoneReportDefs.REASONMISLEADINGSPAM]: RootReportDefs.REASONSPAM, 59 [OzoneReportDefs.REASONMISLEADINGSCAM]: RootReportDefs.REASONMISLEADING, 60 [OzoneReportDefs.REASONMISLEADINGELECTIONS]: RootReportDefs.REASONMISLEADING, 61 [OzoneReportDefs.REASONMISLEADINGOTHER]: RootReportDefs.REASONMISLEADING, 62 63 [OzoneReportDefs.REASONRULESITESECURITY]: RootReportDefs.REASONVIOLATION, 64 [OzoneReportDefs.REASONRULEPROHIBITEDSALES]: RootReportDefs.REASONVIOLATION, 65 [OzoneReportDefs.REASONRULEBANEVASION]: RootReportDefs.REASONVIOLATION, 66 [OzoneReportDefs.REASONRULEOTHER]: RootReportDefs.REASONVIOLATION, 67 68 [OzoneReportDefs.REASONSELFHARMCONTENT]: RootReportDefs.REASONVIOLATION, 69 [OzoneReportDefs.REASONSELFHARMED]: RootReportDefs.REASONVIOLATION, 70 [OzoneReportDefs.REASONSELFHARMSTUNTS]: RootReportDefs.REASONVIOLATION, 71 [OzoneReportDefs.REASONSELFHARMSUBSTANCES]: RootReportDefs.REASONVIOLATION, 72 [OzoneReportDefs.REASONSELFHARMOTHER]: RootReportDefs.REASONVIOLATION, 73} 74 75/** 76 * Mapping of old reason types to new (Ozone namespace) reason types. 77 * @see https://github.com/bluesky-social/proposals/tree/main/0009-mod-report-granularity#backwards-compatibility 78 */ 79export const OLD_TO_NEW_REASONS_MAP: Record< 80 Exclude<RootReportDefs.ReasonType, OzoneReportDefs.ReasonType>, 81 OzoneReportDefs.ReasonType 82> = { 83 [RootReportDefs.REASONSPAM]: [OzoneReportDefs.REASONMISLEADINGSPAM], 84 [RootReportDefs.REASONVIOLATION]: [OzoneReportDefs.REASONRULEOTHER], 85 [RootReportDefs.REASONMISLEADING]: [OzoneReportDefs.REASONMISLEADINGOTHER], 86 [RootReportDefs.REASONSEXUAL]: [OzoneReportDefs.REASONSEXUALUNLABELED], 87 [RootReportDefs.REASONRUDE]: [OzoneReportDefs.REASONHARASSMENTOTHER], 88 [RootReportDefs.REASONOTHER]: [OzoneReportDefs.REASONOTHER], 89 [RootReportDefs.REASONAPPEAL]: [OzoneReportDefs.REASONAPPEAL], 90} 91 92/** 93 * Set of report reasons that should optionally include additional details from 94 * the reporter. 95 */ 96export const OTHER_REPORT_REASONS: Set<OzoneReportDefs.ReasonType> = new Set([ 97 OzoneReportDefs.REASONVIOLENCEOTHER, 98 OzoneReportDefs.REASONSEXUALOTHER, 99 OzoneReportDefs.REASONCHILDSAFETYOTHER, 100 OzoneReportDefs.REASONHARASSMENTOTHER, 101 OzoneReportDefs.REASONMISLEADINGOTHER, 102 OzoneReportDefs.REASONRULEOTHER, 103 OzoneReportDefs.REASONSELFHARMOTHER, 104 OzoneReportDefs.REASONOTHER, 105]) 106 107/** 108 * Set of report reasons that should only be sent to Bluesky's moderation service. 109 */ 110export const BSKY_LABELER_ONLY_REPORT_REASONS: Set<OzoneReportDefs.ReasonType> = 111 new Set([ 112 OzoneReportDefs.REASONCHILDSAFETYCSAM, 113 OzoneReportDefs.REASONCHILDSAFETYGROOM, 114 OzoneReportDefs.REASONCHILDSAFETYOTHER, 115 OzoneReportDefs.REASONVIOLENCEEXTREMISTCONTENT, 116 ]) 117 118/** 119 * Set of _parsed_ subject types that should only be sent to Bluesky's 120 * moderation service. 121 */ 122export const BSKY_LABELER_ONLY_SUBJECT_TYPES: Set<ParsedReportSubject['type']> = 123 new Set(['convoMessage', 'status'])