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