diff --git a/src/components/common/messaging/Message.tsx b/src/components/common/messaging/Message.tsx index 693feadb..e4fec697 100644 --- a/src/components/common/messaging/Message.tsx +++ b/src/components/common/messaging/Message.tsx @@ -63,6 +63,7 @@ const Message = observer( ? useTriggerEvents("Menu", { user: message.author_id, contextualChannel: message.channel_id, + contextualMessage: message._id, // eslint-disable-next-line }) : undefined; diff --git a/src/controllers/modals/components/Report.tsx b/src/controllers/modals/components/Report.tsx index f3441e74..2f967cb9 100644 --- a/src/controllers/modals/components/Report.tsx +++ b/src/controllers/modals/components/Report.tsx @@ -41,6 +41,7 @@ const MessageContainer = styled.div` */ export default function ReportContent({ target, + messageId, ...props }: ModalProps<"report">) { const client = useClient(); @@ -124,6 +125,7 @@ export default function ReportContent({ ? "User" : "Server", report_reason: reason as any, + message_id: messageId, }, additional_context, }); diff --git a/src/controllers/modals/types.ts b/src/controllers/modals/types.ts index 8cdfa375..ff9a1970 100644 --- a/src/controllers/modals/types.ts +++ b/src/controllers/modals/types.ts @@ -182,6 +182,7 @@ export type Modal = { | { type: "report"; target: Server | User | Message; + messageId?: string; } | { type: "report_success"; diff --git a/src/lib/ContextMenus.tsx b/src/lib/ContextMenus.tsx index ab7a674e..2a4ce73d 100644 --- a/src/lib/ContextMenus.tsx +++ b/src/lib/ContextMenus.tsx @@ -47,6 +47,7 @@ interface ContextMenuData { unread?: boolean; queued?: QueuedMessage; contextualChannel?: string; + contextualMessage?: string; } type Action = @@ -112,7 +113,7 @@ type Action = key: string; state?: NotificationState; } - | { action: "report"; target: User | Server | Message }; + | { action: "report"; target: User | Server | Message; messageId?: string }; // ! FIXME: I dare someone to re-write this // Tip: This should just be split into separate context menus per logical area. @@ -454,6 +455,7 @@ export default function ContextMenus() { modalController.push({ type: "report", target: data.target, + messageId: data.messageId, }); break; } @@ -478,6 +480,7 @@ export default function ContextMenus() { queued, unread, contextualChannel: cxid, + contextualMessage, }: ContextMenuData) => { const elements: Children[] = []; let lastDivider = false; @@ -682,6 +685,7 @@ export default function ContextMenus() { { action: "report", target: user, + messageId: contextualMessage, }, "report_user", undefined,