Bluesky app fork with some witchin' additions 💫

Migrate remaining old report reasons, remove old unused file (#9378)

authored by

Eric Bailey and committed by
GitHub
17116264 cb2af3cd

+8 -130
+2 -2
src/components/ageAssurance/AgeAssuranceAppealDialog.tsx
··· 1 1 import React from 'react' 2 2 import {View} from 'react-native' 3 - import {ComAtprotoModerationDefs} from '@atproto/api' 3 + import {ToolsOzoneReportDefs} from '@atproto/api' 4 4 import {msg, Trans} from '@lingui/macro' 5 5 import {useLingui} from '@lingui/react' 6 6 import {useMutation} from '@tanstack/react-query' ··· 50 50 51 51 await agent.createModerationReport( 52 52 { 53 - reasonType: ComAtprotoModerationDefs.REASONAPPEAL, 53 + reasonType: ToolsOzoneReportDefs.REASONAPPEAL, 54 54 subject: { 55 55 $type: 'com.atproto.admin.defs#repoRef', 56 56 did: currentAccount?.did,
+2 -2
src/components/moderation/LabelsOnMeDialog.tsx
··· 1 1 import React, {useState} from 'react' 2 2 import {View} from 'react-native' 3 - import {type ComAtprotoLabelDefs, ComAtprotoModerationDefs} from '@atproto/api' 3 + import {type ComAtprotoLabelDefs, ToolsOzoneReportDefs} from '@atproto/api' 4 4 import {XRPCError} from '@atproto/xrpc' 5 5 import {msg, Trans} from '@lingui/macro' 6 6 import {useLingui} from '@lingui/react' ··· 239 239 : 'com.atproto.admin.defs#repoRef' 240 240 await agent.createModerationReport( 241 241 { 242 - reasonType: ComAtprotoModerationDefs.REASONAPPEAL, 242 + reasonType: ToolsOzoneReportDefs.REASONAPPEAL, 243 243 subject: { 244 244 $type, 245 245 ...subject,
-122
src/lib/moderation/useReportOptions.ts
··· 1 - import {useMemo} from 'react' 2 - import {ComAtprotoModerationDefs} from '@atproto/api' 3 - import {msg} from '@lingui/macro' 4 - import {useLingui} from '@lingui/react' 5 - 6 - export interface ReportOption { 7 - reason: string 8 - title: string 9 - description: string 10 - } 11 - 12 - interface ReportOptions { 13 - account: ReportOption[] 14 - post: ReportOption[] 15 - list: ReportOption[] 16 - starterpack: ReportOption[] 17 - feedgen: ReportOption[] 18 - other: ReportOption[] 19 - convoMessage: ReportOption[] 20 - } 21 - 22 - export function useReportOptions(): ReportOptions { 23 - const {_} = useLingui() 24 - return useMemo(() => { 25 - const other = { 26 - reason: ComAtprotoModerationDefs.REASONOTHER, 27 - title: _(msg`Other`), 28 - description: _(msg`An issue not included in these options`), 29 - } 30 - const common = [ 31 - { 32 - reason: ComAtprotoModerationDefs.REASONRUDE, 33 - title: _(msg`Anti-Social Behavior`), 34 - description: _(msg`Harassment, trolling, or intolerance`), 35 - }, 36 - { 37 - reason: ComAtprotoModerationDefs.REASONVIOLATION, 38 - title: _(msg`Illegal and Urgent`), 39 - description: _(msg`Glaring violations of law or terms of service`), 40 - }, 41 - other, 42 - ] 43 - return { 44 - account: [ 45 - { 46 - reason: ComAtprotoModerationDefs.REASONMISLEADING, 47 - title: _(msg`Misleading Account`), 48 - description: _( 49 - msg`Impersonation or false claims about identity or affiliation`, 50 - ), 51 - }, 52 - { 53 - reason: ComAtprotoModerationDefs.REASONSPAM, 54 - title: _(msg`Frequently Posts Unwanted Content`), 55 - description: _(msg`Spam; excessive mentions or replies`), 56 - }, 57 - { 58 - reason: ComAtprotoModerationDefs.REASONVIOLATION, 59 - title: _(msg`Name or Description Violates Community Standards`), 60 - description: _(msg`Terms used violate community standards`), 61 - }, 62 - other, 63 - ], 64 - post: [ 65 - { 66 - reason: ComAtprotoModerationDefs.REASONMISLEADING, 67 - title: _(msg`Misleading Post`), 68 - description: _(msg`Impersonation, misinformation, or false claims`), 69 - }, 70 - { 71 - reason: ComAtprotoModerationDefs.REASONSPAM, 72 - title: _(msg`Spam`), 73 - description: _(msg`Excessive mentions or replies`), 74 - }, 75 - { 76 - reason: ComAtprotoModerationDefs.REASONSEXUAL, 77 - title: _(msg`Unwanted Sexual Content`), 78 - description: _(msg`Nudity or adult content not labeled as such`), 79 - }, 80 - ...common, 81 - ], 82 - convoMessage: [ 83 - { 84 - reason: ComAtprotoModerationDefs.REASONSPAM, 85 - title: _(msg`Spam`), 86 - description: _(msg`Excessive or unwanted messages`), 87 - }, 88 - { 89 - reason: ComAtprotoModerationDefs.REASONSEXUAL, 90 - title: _(msg`Unwanted Sexual Content`), 91 - description: _(msg`Inappropriate messages or explicit links`), 92 - }, 93 - ...common, 94 - ], 95 - list: [ 96 - { 97 - reason: ComAtprotoModerationDefs.REASONVIOLATION, 98 - title: _(msg`Name or Description Violates Community Standards`), 99 - description: _(msg`Terms used violate community standards`), 100 - }, 101 - ...common, 102 - ], 103 - starterpack: [ 104 - { 105 - reason: ComAtprotoModerationDefs.REASONVIOLATION, 106 - title: _(msg`Name or Description Violates Community Standards`), 107 - description: _(msg`Terms used violate community standards`), 108 - }, 109 - ...common, 110 - ], 111 - feedgen: [ 112 - { 113 - reason: ComAtprotoModerationDefs.REASONVIOLATION, 114 - title: _(msg`Name or Description Violates Community Standards`), 115 - description: _(msg`Terms used violate community standards`), 116 - }, 117 - ...common, 118 - ], 119 - other: common, 120 - } 121 - }, [_]) 122 - }
+2 -2
src/screens/Messages/components/ChatDisabled.tsx
··· 1 1 import {useCallback, useState} from 'react' 2 2 import {View} from 'react-native' 3 - import {ComAtprotoModerationDefs} from '@atproto/api' 3 + import {ToolsOzoneReportDefs} from '@atproto/api' 4 4 import {msg, Trans} from '@lingui/macro' 5 5 import {useLingui} from '@lingui/react' 6 6 import {useMutation} from '@tanstack/react-query' ··· 81 81 throw new Error('No current account, should be unreachable') 82 82 await agent.createModerationReport( 83 83 { 84 - reasonType: ComAtprotoModerationDefs.REASONAPPEAL, 84 + reasonType: ToolsOzoneReportDefs.REASONAPPEAL, 85 85 subject: { 86 86 $type: 'com.atproto.admin.defs#repoRef', 87 87 did: currentAccount.did,
+2 -2
src/screens/Takendown.tsx
··· 3 3 import {SystemBars} from 'react-native-edge-to-edge' 4 4 import {KeyboardAwareScrollView} from 'react-native-keyboard-controller' 5 5 import {useSafeAreaInsets} from 'react-native-safe-area-context' 6 - import {type ComAtprotoAdminDefs, ComAtprotoModerationDefs} from '@atproto/api' 6 + import {type ComAtprotoAdminDefs, ToolsOzoneReportDefs} from '@atproto/api' 7 7 import {msg, Trans} from '@lingui/macro' 8 8 import {useLingui} from '@lingui/react' 9 9 import {useMutation} from '@tanstack/react-query' ··· 54 54 if (!currentAccount) throw new Error('No session') 55 55 await agent.com.atproto.moderation.createReport( 56 56 { 57 - reasonType: ComAtprotoModerationDefs.REASONAPPEAL, 57 + reasonType: ToolsOzoneReportDefs.REASONAPPEAL, 58 58 subject: { 59 59 $type: 'com.atproto.admin.defs#repoRef', 60 60 did: currentAccount.did,