diff --git a/docs/rfcs/2024-12-07-content-complaints.md b/docs/rfcs/2024-12-07-content-complaints.md new file mode 100644 index 0000000000..065009ebcc --- /dev/null +++ b/docs/rfcs/2024-12-07-content-complaints.md @@ -0,0 +1,16 @@ +# Content complaints + +## Problem + +As groups count and size grows, and as we are moving to working large groups, so will the abuse, so we need report function for active groups that would forward the message that members may find offensive or inappropriate or off-topic or violating any rules that community wants to have. + +It doesn't mean that the moderators must censor everything that is reported, and even less so, it should be centralized (although in our directory our directory bot would also receive these complaints). + +## Solution + +A new protocol message that is sent via the existing connection in the group only to group moderators, admins and owners. + +These messages will appear in the special folder "Reports" in admin/owner profiles, with the information about the message itself and who sent it and in which group, with the ability to navigate to that message, delete or mark as deleted. + +To send, the members would choose Report from the context menu (that would complement Moderate function available to group admins) and then choose the reason: e.g., Illegal, Inappropriate, Off-topic. + diff --git a/src/Simplex/Chat/Protocol.hs b/src/Simplex/Chat/Protocol.hs index 934f23007d..76a0839005 100644 --- a/src/Simplex/Chat/Protocol.hs +++ b/src/Simplex/Chat/Protocol.hs @@ -308,6 +308,7 @@ data ChatMsgEvent (e :: MsgEncoding) where XGrpPrefs :: GroupPreferences -> ChatMsgEvent 'Json XGrpDirectInv :: ConnReqInvitation -> Maybe MsgContent -> ChatMsgEvent 'Json XGrpMsgForward :: MemberId -> ChatMessage 'Json -> UTCTime -> ChatMsgEvent 'Json + XGrpMsgReport :: MemberId -> ChatMessage 'Json -> UTCTime -> ChatMsgEvent 'Json XInfoProbe :: Probe -> ChatMsgEvent 'Json XInfoProbeCheck :: ProbeHash -> ChatMsgEvent 'Json XInfoProbeOk :: Probe -> ChatMsgEvent 'Json @@ -732,6 +733,7 @@ data CMEventTag (e :: MsgEncoding) where XGrpPrefs_ :: CMEventTag 'Json XGrpDirectInv_ :: CMEventTag 'Json XGrpMsgForward_ :: CMEventTag 'Json + XGrpMsgReport_ :: CMEventTag 'Json XInfoProbe_ :: CMEventTag 'Json XInfoProbeCheck_ :: CMEventTag 'Json XInfoProbeOk_ :: CMEventTag 'Json @@ -783,6 +785,7 @@ instance MsgEncodingI e => StrEncoding (CMEventTag e) where XGrpPrefs_ -> "x.grp.prefs" XGrpDirectInv_ -> "x.grp.direct.inv" XGrpMsgForward_ -> "x.grp.msg.forward" + XGrpMsgReport_ -> "x.grp.msg.report" XInfoProbe_ -> "x.info.probe" XInfoProbeCheck_ -> "x.info.probe.check" XInfoProbeOk_ -> "x.info.probe.ok" @@ -883,6 +886,7 @@ toCMEventTag msg = case msg of XGrpPrefs _ -> XGrpPrefs_ XGrpDirectInv _ _ -> XGrpDirectInv_ XGrpMsgForward {} -> XGrpMsgForward_ + XGrpMsgReport {} -> XGrpMsgReport_ XInfoProbe _ -> XInfoProbe_ XInfoProbeCheck _ -> XInfoProbeCheck_ XInfoProbeOk _ -> XInfoProbeOk_ @@ -984,6 +988,7 @@ appJsonToCM AppMessageJson {v, msgId, event, params} = do XGrpPrefs_ -> XGrpPrefs <$> p "groupPreferences" XGrpDirectInv_ -> XGrpDirectInv <$> p "connReq" <*> opt "content" XGrpMsgForward_ -> XGrpMsgForward <$> p "memberId" <*> p "msg" <*> p "msgTs" + XGrpMsgReport_ -> XGrpMsgReport <$> p "memberId" <*> p "msg" <*> p "msgTs" XInfoProbe_ -> XInfoProbe <$> p "probe" XInfoProbeCheck_ -> XInfoProbeCheck <$> p "probeHash" XInfoProbeOk_ -> XInfoProbeOk <$> p "probe" @@ -1046,6 +1051,7 @@ chatToAppMessage ChatMessage {chatVRange, msgId, chatMsgEvent} = case encoding @ XGrpPrefs p -> o ["groupPreferences" .= p] XGrpDirectInv connReq content -> o $ ("content" .=? content) ["connReq" .= connReq] XGrpMsgForward memberId msg msgTs -> o ["memberId" .= memberId, "msg" .= msg, "msgTs" .= msgTs] + XGrpMsgReport memberId msg msgTs -> o ["memberId" .= memberId, "msg" .= msg, "msgTs" .= msgTs] XInfoProbe probe -> o ["probe" .= probe] XInfoProbeCheck probeHash -> o ["probeHash" .= probeHash] XInfoProbeOk probe -> o ["probe" .= probe]