Compare commits

...

1 Commits

Author SHA1 Message Date
Evgeny Poberezkin c143683959 rfc: group content reports 2024-12-06 23:26:31 +00:00
2 changed files with 22 additions and 0 deletions
@@ -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.
+6
View File
@@ -308,6 +308,7 @@ data ChatMsgEvent (e :: MsgEncoding) where
XGrpPrefs :: GroupPreferences -> ChatMsgEvent 'Json XGrpPrefs :: GroupPreferences -> ChatMsgEvent 'Json
XGrpDirectInv :: ConnReqInvitation -> Maybe MsgContent -> ChatMsgEvent 'Json XGrpDirectInv :: ConnReqInvitation -> Maybe MsgContent -> ChatMsgEvent 'Json
XGrpMsgForward :: MemberId -> ChatMessage 'Json -> UTCTime -> ChatMsgEvent 'Json XGrpMsgForward :: MemberId -> ChatMessage 'Json -> UTCTime -> ChatMsgEvent 'Json
XGrpMsgReport :: MemberId -> ChatMessage 'Json -> UTCTime -> ChatMsgEvent 'Json
XInfoProbe :: Probe -> ChatMsgEvent 'Json XInfoProbe :: Probe -> ChatMsgEvent 'Json
XInfoProbeCheck :: ProbeHash -> ChatMsgEvent 'Json XInfoProbeCheck :: ProbeHash -> ChatMsgEvent 'Json
XInfoProbeOk :: Probe -> ChatMsgEvent 'Json XInfoProbeOk :: Probe -> ChatMsgEvent 'Json
@@ -732,6 +733,7 @@ data CMEventTag (e :: MsgEncoding) where
XGrpPrefs_ :: CMEventTag 'Json XGrpPrefs_ :: CMEventTag 'Json
XGrpDirectInv_ :: CMEventTag 'Json XGrpDirectInv_ :: CMEventTag 'Json
XGrpMsgForward_ :: CMEventTag 'Json XGrpMsgForward_ :: CMEventTag 'Json
XGrpMsgReport_ :: CMEventTag 'Json
XInfoProbe_ :: CMEventTag 'Json XInfoProbe_ :: CMEventTag 'Json
XInfoProbeCheck_ :: CMEventTag 'Json XInfoProbeCheck_ :: CMEventTag 'Json
XInfoProbeOk_ :: CMEventTag 'Json XInfoProbeOk_ :: CMEventTag 'Json
@@ -783,6 +785,7 @@ instance MsgEncodingI e => StrEncoding (CMEventTag e) where
XGrpPrefs_ -> "x.grp.prefs" XGrpPrefs_ -> "x.grp.prefs"
XGrpDirectInv_ -> "x.grp.direct.inv" XGrpDirectInv_ -> "x.grp.direct.inv"
XGrpMsgForward_ -> "x.grp.msg.forward" XGrpMsgForward_ -> "x.grp.msg.forward"
XGrpMsgReport_ -> "x.grp.msg.report"
XInfoProbe_ -> "x.info.probe" XInfoProbe_ -> "x.info.probe"
XInfoProbeCheck_ -> "x.info.probe.check" XInfoProbeCheck_ -> "x.info.probe.check"
XInfoProbeOk_ -> "x.info.probe.ok" XInfoProbeOk_ -> "x.info.probe.ok"
@@ -883,6 +886,7 @@ toCMEventTag msg = case msg of
XGrpPrefs _ -> XGrpPrefs_ XGrpPrefs _ -> XGrpPrefs_
XGrpDirectInv _ _ -> XGrpDirectInv_ XGrpDirectInv _ _ -> XGrpDirectInv_
XGrpMsgForward {} -> XGrpMsgForward_ XGrpMsgForward {} -> XGrpMsgForward_
XGrpMsgReport {} -> XGrpMsgReport_
XInfoProbe _ -> XInfoProbe_ XInfoProbe _ -> XInfoProbe_
XInfoProbeCheck _ -> XInfoProbeCheck_ XInfoProbeCheck _ -> XInfoProbeCheck_
XInfoProbeOk _ -> XInfoProbeOk_ XInfoProbeOk _ -> XInfoProbeOk_
@@ -984,6 +988,7 @@ appJsonToCM AppMessageJson {v, msgId, event, params} = do
XGrpPrefs_ -> XGrpPrefs <$> p "groupPreferences" XGrpPrefs_ -> XGrpPrefs <$> p "groupPreferences"
XGrpDirectInv_ -> XGrpDirectInv <$> p "connReq" <*> opt "content" XGrpDirectInv_ -> XGrpDirectInv <$> p "connReq" <*> opt "content"
XGrpMsgForward_ -> XGrpMsgForward <$> p "memberId" <*> p "msg" <*> p "msgTs" XGrpMsgForward_ -> XGrpMsgForward <$> p "memberId" <*> p "msg" <*> p "msgTs"
XGrpMsgReport_ -> XGrpMsgReport <$> p "memberId" <*> p "msg" <*> p "msgTs"
XInfoProbe_ -> XInfoProbe <$> p "probe" XInfoProbe_ -> XInfoProbe <$> p "probe"
XInfoProbeCheck_ -> XInfoProbeCheck <$> p "probeHash" XInfoProbeCheck_ -> XInfoProbeCheck <$> p "probeHash"
XInfoProbeOk_ -> XInfoProbeOk <$> p "probe" XInfoProbeOk_ -> XInfoProbeOk <$> p "probe"
@@ -1046,6 +1051,7 @@ chatToAppMessage ChatMessage {chatVRange, msgId, chatMsgEvent} = case encoding @
XGrpPrefs p -> o ["groupPreferences" .= p] XGrpPrefs p -> o ["groupPreferences" .= p]
XGrpDirectInv connReq content -> o $ ("content" .=? content) ["connReq" .= connReq] XGrpDirectInv connReq content -> o $ ("content" .=? content) ["connReq" .= connReq]
XGrpMsgForward memberId msg msgTs -> o ["memberId" .= memberId, "msg" .= msg, "msgTs" .= msgTs] 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] XInfoProbe probe -> o ["probe" .= probe]
XInfoProbeCheck probeHash -> o ["probeHash" .= probeHash] XInfoProbeCheck probeHash -> o ["probeHash" .= probeHash]
XInfoProbeOk probe -> o ["probe" .= probe] XInfoProbeOk probe -> o ["probe" .= probe]