about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/components/ReportDialog/SelectReportOptionView.tsx3
-rw-r--r--src/components/ReportDialog/types.ts1
-rw-r--r--src/components/dms/ConvoMenu.tsx7
-rw-r--r--src/components/dms/MessagesListBlockedFooter.tsx7
-rw-r--r--src/components/dms/ReportConversationPrompt.tsx27
-rw-r--r--src/components/dms/ReportDialog.tsx43
-rw-r--r--src/lib/moderation/useReportOptions.ts14
7 files changed, 39 insertions, 63 deletions
diff --git a/src/components/ReportDialog/SelectReportOptionView.tsx b/src/components/ReportDialog/SelectReportOptionView.tsx
index 405384476..4413cbe89 100644
--- a/src/components/ReportDialog/SelectReportOptionView.tsx
+++ b/src/components/ReportDialog/SelectReportOptionView.tsx
@@ -58,9 +58,6 @@ export function SelectReportOptionView({
     } else if (props.params.type === 'convoMessage') {
       title = _(msg`Report this message`)
       description = _(msg`Why should this message be reviewed?`)
-    } else if (props.params.type === 'convoAccount') {
-      title = _(msg`Report this account`)
-      description = _(msg`Why should this account be reviewed?`)
     }
 
     return {
diff --git a/src/components/ReportDialog/types.ts b/src/components/ReportDialog/types.ts
index 5a1385652..ceabe0b90 100644
--- a/src/components/ReportDialog/types.ts
+++ b/src/components/ReportDialog/types.ts
@@ -13,5 +13,4 @@ export type ReportDialogProps = {
         did: string
       }
     | {type: 'convoMessage'}
-    | {type: 'convoAccount'}
 }
diff --git a/src/components/dms/ConvoMenu.tsx b/src/components/dms/ConvoMenu.tsx
index 50a528084..0e5cd12bf 100644
--- a/src/components/dms/ConvoMenu.tsx
+++ b/src/components/dms/ConvoMenu.tsx
@@ -21,7 +21,7 @@ import * as Toast from '#/view/com/util/Toast'
 import {atoms as a, useTheme} from '#/alf'
 import {BlockedByListDialog} from '#/components/dms/BlockedByListDialog'
 import {LeaveConvoPrompt} from '#/components/dms/LeaveConvoPrompt'
-import {ReportDialog} from '#/components/dms/ReportDialog'
+import {ReportConversationPrompt} from '#/components/dms/ReportConversationPrompt'
 import {ArrowBoxLeft_Stroke2_Corner0_Rounded as ArrowBoxLeft} from '#/components/icons/ArrowBoxLeft'
 import {DotGrid_Stroke2_Corner0_Rounded as DotsHorizontal} from '#/components/icons/DotGrid'
 import {Flag_Stroke2_Corner0_Rounded as Flag} from '#/components/icons/Flag'
@@ -205,10 +205,7 @@ let ConvoMenu = ({
         convoId={convo.id}
         currentScreen={currentScreen}
       />
-      <ReportDialog
-        control={reportControl}
-        params={{type: 'convoAccount', did: profile.did, convoId: convo.id}}
-      />
+      <ReportConversationPrompt control={reportControl} />
       <BlockedByListDialog
         control={blockedByListControl}
         listBlocks={listBlocks}
diff --git a/src/components/dms/MessagesListBlockedFooter.tsx b/src/components/dms/MessagesListBlockedFooter.tsx
index 7cf6f5852..a018b8623 100644
--- a/src/components/dms/MessagesListBlockedFooter.tsx
+++ b/src/components/dms/MessagesListBlockedFooter.tsx
@@ -12,7 +12,7 @@ import {useDialogControl} from '#/components/Dialog'
 import {Divider} from '#/components/Divider'
 import {BlockedByListDialog} from '#/components/dms/BlockedByListDialog'
 import {LeaveConvoPrompt} from '#/components/dms/LeaveConvoPrompt'
-import {ReportDialog} from '#/components/dms/ReportDialog'
+import {ReportConversationPrompt} from '#/components/dms/ReportConversationPrompt'
 import {Text} from '#/components/Typography'
 
 export function MessagesListBlockedFooter({
@@ -120,10 +120,7 @@ export function MessagesListBlockedFooter({
         convoId={convoId}
       />
 
-      <ReportDialog
-        control={reportControl}
-        params={{type: 'convoAccount', did: recipient.did, convoId}}
-      />
+      <ReportConversationPrompt control={reportControl} />
 
       <BlockedByListDialog
         control={blockedByListControl}
diff --git a/src/components/dms/ReportConversationPrompt.tsx b/src/components/dms/ReportConversationPrompt.tsx
new file mode 100644
index 000000000..610cfbcf9
--- /dev/null
+++ b/src/components/dms/ReportConversationPrompt.tsx
@@ -0,0 +1,27 @@
+import React from 'react'
+import {msg} from '@lingui/macro'
+import {useLingui} from '@lingui/react'
+
+import {DialogControlProps} from '#/components/Dialog'
+import * as Prompt from '#/components/Prompt'
+
+export function ReportConversationPrompt({
+  control,
+}: {
+  control: DialogControlProps
+}) {
+  const {_} = useLingui()
+
+  return (
+    <Prompt.Basic
+      control={control}
+      title={_(msg`Report conversation`)}
+      description={_(
+        msg`To report a conversation, please report one of its messages via the conversation screen. This lets our moderators understand the context of your issue.`,
+      )}
+      confirmButtonCta={_(msg`I understand`)}
+      onConfirm={() => {}}
+      showCancel={false}
+    />
+  )
+}
diff --git a/src/components/dms/ReportDialog.tsx b/src/components/dms/ReportDialog.tsx
index e8ac0ed2f..63e4cd79e 100644
--- a/src/components/dms/ReportDialog.tsx
+++ b/src/components/dms/ReportDialog.tsx
@@ -25,17 +25,11 @@ import {RichText} from '../RichText'
 import {Text} from '../Typography'
 import {MessageItemMetadata} from './MessageItem'
 
-type ReportDialogParams =
-  | {
-      type: 'convoAccount'
-      did: string
-      convoId: string
-    }
-  | {
-      type: 'convoMessage'
-      convoId: string
-      message: ChatBskyConvoDefs.MessageView
-    }
+type ReportDialogParams = {
+  type: 'convoMessage'
+  convoId: string
+  message: ChatBskyConvoDefs.MessageView
+}
 
 let ReportDialog = ({
   control,
@@ -76,7 +70,6 @@ function DialogInner({params}: {params: ReportDialogParams}) {
 
 function ReasonStep({
   setReportOption,
-  params,
 }: {
   setReportOption: (reportOption: ReportOption) => void
   params: ReportDialogParams
@@ -87,15 +80,9 @@ function ReasonStep({
     <SelectReportOptionView
       labelers={[]}
       goBack={control.close}
-      params={
-        params.type === 'convoMessage'
-          ? {
-              type: 'convoMessage',
-            }
-          : {
-              type: 'convoAccount',
-            }
-      }
+      params={{
+        type: 'convoMessage',
+      }}
       onSelectReportOption={setReportOption}
     />
   )
@@ -138,17 +125,6 @@ function SubmitStep({
         } satisfies ComAtprotoModerationCreateReport.InputSchema
 
         await getAgent().createModerationReport(report)
-      } else if (params.type === 'convoAccount') {
-        const {convoId, did} = params
-
-        await getAgent().createModerationReport({
-          reasonType: reportOption.reason,
-          subject: {
-            $type: 'com.atproto.admin.defs#repoRef',
-            did,
-          },
-          reason: details + ` — from:dms:${convoId}`,
-        })
       }
     },
     onSuccess: () => {
@@ -163,9 +139,6 @@ function SubmitStep({
       convoMessage: {
         title: _(msg`Report this message`),
       },
-      convoAccount: {
-        title: _(msg`Report this account`),
-      },
     }[params.type]
   }, [_, params])
 
diff --git a/src/lib/moderation/useReportOptions.ts b/src/lib/moderation/useReportOptions.ts
index 6533004c4..54b727b76 100644
--- a/src/lib/moderation/useReportOptions.ts
+++ b/src/lib/moderation/useReportOptions.ts
@@ -16,7 +16,6 @@ interface ReportOptions {
   feedgen: ReportOption[]
   other: ReportOption[]
   convoMessage: ReportOption[]
-  convoAccount: ReportOption[]
 }
 
 export function useReportOptions(): ReportOptions {
@@ -87,19 +86,6 @@ export function useReportOptions(): ReportOptions {
         },
         ...common,
       ],
-      convoAccount: [
-        {
-          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,