Migrate remaining old report reasons, remove old unused file
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import {View} from 'react-native'
|
import {View} from 'react-native'
|
||||||
import {ComAtprotoModerationDefs} from '@atproto/api'
|
import {ToolsOzoneReportDefs} from '@atproto/api'
|
||||||
import {msg, Trans} from '@lingui/macro'
|
import {msg, Trans} from '@lingui/macro'
|
||||||
import {useLingui} from '@lingui/react'
|
import {useLingui} from '@lingui/react'
|
||||||
import {useMutation} from '@tanstack/react-query'
|
import {useMutation} from '@tanstack/react-query'
|
||||||
@@ -50,7 +50,7 @@ function Inner({control}: {control: Dialog.DialogControlProps}) {
|
|||||||
|
|
||||||
await agent.createModerationReport(
|
await agent.createModerationReport(
|
||||||
{
|
{
|
||||||
reasonType: ComAtprotoModerationDefs.REASONAPPEAL,
|
reasonType: ToolsOzoneReportDefs.REASONAPPEAL,
|
||||||
subject: {
|
subject: {
|
||||||
$type: 'com.atproto.admin.defs#repoRef',
|
$type: 'com.atproto.admin.defs#repoRef',
|
||||||
did: currentAccount?.did,
|
did: currentAccount?.did,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React, {useState} from 'react'
|
import React, {useState} from 'react'
|
||||||
import {View} from 'react-native'
|
import {View} from 'react-native'
|
||||||
import {type ComAtprotoLabelDefs, ComAtprotoModerationDefs} from '@atproto/api'
|
import {type ComAtprotoLabelDefs, ToolsOzoneReportDefs} from '@atproto/api'
|
||||||
import {XRPCError} from '@atproto/xrpc'
|
import {XRPCError} from '@atproto/xrpc'
|
||||||
import {msg, Trans} from '@lingui/macro'
|
import {msg, Trans} from '@lingui/macro'
|
||||||
import {useLingui} from '@lingui/react'
|
import {useLingui} from '@lingui/react'
|
||||||
@@ -239,7 +239,7 @@ function AppealForm({
|
|||||||
: 'com.atproto.admin.defs#repoRef'
|
: 'com.atproto.admin.defs#repoRef'
|
||||||
await agent.createModerationReport(
|
await agent.createModerationReport(
|
||||||
{
|
{
|
||||||
reasonType: ComAtprotoModerationDefs.REASONAPPEAL,
|
reasonType: ToolsOzoneReportDefs.REASONAPPEAL,
|
||||||
subject: {
|
subject: {
|
||||||
$type,
|
$type,
|
||||||
...subject,
|
...subject,
|
||||||
|
|||||||
@@ -1,122 +0,0 @@
|
|||||||
import {useMemo} from 'react'
|
|
||||||
import {ComAtprotoModerationDefs} from '@atproto/api'
|
|
||||||
import {msg} from '@lingui/macro'
|
|
||||||
import {useLingui} from '@lingui/react'
|
|
||||||
|
|
||||||
export interface ReportOption {
|
|
||||||
reason: string
|
|
||||||
title: string
|
|
||||||
description: string
|
|
||||||
}
|
|
||||||
|
|
||||||
interface ReportOptions {
|
|
||||||
account: ReportOption[]
|
|
||||||
post: ReportOption[]
|
|
||||||
list: ReportOption[]
|
|
||||||
starterpack: ReportOption[]
|
|
||||||
feedgen: ReportOption[]
|
|
||||||
other: ReportOption[]
|
|
||||||
convoMessage: ReportOption[]
|
|
||||||
}
|
|
||||||
|
|
||||||
export function useReportOptions(): ReportOptions {
|
|
||||||
const {_} = useLingui()
|
|
||||||
return useMemo(() => {
|
|
||||||
const other = {
|
|
||||||
reason: ComAtprotoModerationDefs.REASONOTHER,
|
|
||||||
title: _(msg`Other`),
|
|
||||||
description: _(msg`An issue not included in these options`),
|
|
||||||
}
|
|
||||||
const common = [
|
|
||||||
{
|
|
||||||
reason: ComAtprotoModerationDefs.REASONRUDE,
|
|
||||||
title: _(msg`Anti-Social Behavior`),
|
|
||||||
description: _(msg`Harassment, trolling, or intolerance`),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
reason: ComAtprotoModerationDefs.REASONVIOLATION,
|
|
||||||
title: _(msg`Illegal and Urgent`),
|
|
||||||
description: _(msg`Glaring violations of law or terms of service`),
|
|
||||||
},
|
|
||||||
other,
|
|
||||||
]
|
|
||||||
return {
|
|
||||||
account: [
|
|
||||||
{
|
|
||||||
reason: ComAtprotoModerationDefs.REASONMISLEADING,
|
|
||||||
title: _(msg`Misleading Account`),
|
|
||||||
description: _(
|
|
||||||
msg`Impersonation or false claims about identity or affiliation`,
|
|
||||||
),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
reason: ComAtprotoModerationDefs.REASONSPAM,
|
|
||||||
title: _(msg`Frequently Posts Unwanted Content`),
|
|
||||||
description: _(msg`Spam; excessive mentions or replies`),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
reason: ComAtprotoModerationDefs.REASONVIOLATION,
|
|
||||||
title: _(msg`Name or Description Violates Community Standards`),
|
|
||||||
description: _(msg`Terms used violate community standards`),
|
|
||||||
},
|
|
||||||
other,
|
|
||||||
],
|
|
||||||
post: [
|
|
||||||
{
|
|
||||||
reason: ComAtprotoModerationDefs.REASONMISLEADING,
|
|
||||||
title: _(msg`Misleading Post`),
|
|
||||||
description: _(msg`Impersonation, misinformation, or false claims`),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
reason: ComAtprotoModerationDefs.REASONSPAM,
|
|
||||||
title: _(msg`Spam`),
|
|
||||||
description: _(msg`Excessive mentions or replies`),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
reason: ComAtprotoModerationDefs.REASONSEXUAL,
|
|
||||||
title: _(msg`Unwanted Sexual Content`),
|
|
||||||
description: _(msg`Nudity or adult content not labeled as such`),
|
|
||||||
},
|
|
||||||
...common,
|
|
||||||
],
|
|
||||||
convoMessage: [
|
|
||||||
{
|
|
||||||
reason: ComAtprotoModerationDefs.REASONSPAM,
|
|
||||||
title: _(msg`Spam`),
|
|
||||||
description: _(msg`Excessive or unwanted messages`),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
reason: ComAtprotoModerationDefs.REASONSEXUAL,
|
|
||||||
title: _(msg`Unwanted Sexual Content`),
|
|
||||||
description: _(msg`Inappropriate messages or explicit links`),
|
|
||||||
},
|
|
||||||
...common,
|
|
||||||
],
|
|
||||||
list: [
|
|
||||||
{
|
|
||||||
reason: ComAtprotoModerationDefs.REASONVIOLATION,
|
|
||||||
title: _(msg`Name or Description Violates Community Standards`),
|
|
||||||
description: _(msg`Terms used violate community standards`),
|
|
||||||
},
|
|
||||||
...common,
|
|
||||||
],
|
|
||||||
starterpack: [
|
|
||||||
{
|
|
||||||
reason: ComAtprotoModerationDefs.REASONVIOLATION,
|
|
||||||
title: _(msg`Name or Description Violates Community Standards`),
|
|
||||||
description: _(msg`Terms used violate community standards`),
|
|
||||||
},
|
|
||||||
...common,
|
|
||||||
],
|
|
||||||
feedgen: [
|
|
||||||
{
|
|
||||||
reason: ComAtprotoModerationDefs.REASONVIOLATION,
|
|
||||||
title: _(msg`Name or Description Violates Community Standards`),
|
|
||||||
description: _(msg`Terms used violate community standards`),
|
|
||||||
},
|
|
||||||
...common,
|
|
||||||
],
|
|
||||||
other: common,
|
|
||||||
}
|
|
||||||
}, [_])
|
|
||||||
}
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import {useCallback, useState} from 'react'
|
import {useCallback, useState} from 'react'
|
||||||
import {View} from 'react-native'
|
import {View} from 'react-native'
|
||||||
import {ComAtprotoModerationDefs} from '@atproto/api'
|
import {ToolsOzoneReportDefs} from '@atproto/api'
|
||||||
import {msg, Trans} from '@lingui/macro'
|
import {msg, Trans} from '@lingui/macro'
|
||||||
import {useLingui} from '@lingui/react'
|
import {useLingui} from '@lingui/react'
|
||||||
import {useMutation} from '@tanstack/react-query'
|
import {useMutation} from '@tanstack/react-query'
|
||||||
@@ -81,7 +81,7 @@ function DialogInner() {
|
|||||||
throw new Error('No current account, should be unreachable')
|
throw new Error('No current account, should be unreachable')
|
||||||
await agent.createModerationReport(
|
await agent.createModerationReport(
|
||||||
{
|
{
|
||||||
reasonType: ComAtprotoModerationDefs.REASONAPPEAL,
|
reasonType: ToolsOzoneReportDefs.REASONAPPEAL,
|
||||||
subject: {
|
subject: {
|
||||||
$type: 'com.atproto.admin.defs#repoRef',
|
$type: 'com.atproto.admin.defs#repoRef',
|
||||||
did: currentAccount.did,
|
did: currentAccount.did,
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import {Modal, View} from 'react-native'
|
|||||||
import {SystemBars} from 'react-native-edge-to-edge'
|
import {SystemBars} from 'react-native-edge-to-edge'
|
||||||
import {KeyboardAwareScrollView} from 'react-native-keyboard-controller'
|
import {KeyboardAwareScrollView} from 'react-native-keyboard-controller'
|
||||||
import {useSafeAreaInsets} from 'react-native-safe-area-context'
|
import {useSafeAreaInsets} from 'react-native-safe-area-context'
|
||||||
import {type ComAtprotoAdminDefs, ComAtprotoModerationDefs} from '@atproto/api'
|
import {type ComAtprotoAdminDefs, ToolsOzoneReportDefs} from '@atproto/api'
|
||||||
import {msg, Trans} from '@lingui/macro'
|
import {msg, Trans} from '@lingui/macro'
|
||||||
import {useLingui} from '@lingui/react'
|
import {useLingui} from '@lingui/react'
|
||||||
import {useMutation} from '@tanstack/react-query'
|
import {useMutation} from '@tanstack/react-query'
|
||||||
@@ -54,7 +54,7 @@ export function Takendown() {
|
|||||||
if (!currentAccount) throw new Error('No session')
|
if (!currentAccount) throw new Error('No session')
|
||||||
await agent.com.atproto.moderation.createReport(
|
await agent.com.atproto.moderation.createReport(
|
||||||
{
|
{
|
||||||
reasonType: ComAtprotoModerationDefs.REASONAPPEAL,
|
reasonType: ToolsOzoneReportDefs.REASONAPPEAL,
|
||||||
subject: {
|
subject: {
|
||||||
$type: 'com.atproto.admin.defs#repoRef',
|
$type: 'com.atproto.admin.defs#repoRef',
|
||||||
did: currentAccount.did,
|
did: currentAccount.did,
|
||||||
|
|||||||
Reference in New Issue
Block a user