core: forward compatible support for owners/admins/moderations deleting channel and public group messages without limitations (#6962)

* plan: delete channel messages

* core: allow deletion of own messages in public groups in channels to moderators-owners

---------

Co-authored-by: Evgeny @ SimpleX Chat <259188159+evgeny-simplex@users.noreply.github.com>
This commit is contained in:
Evgeny
2026-05-11 15:00:37 +01:00
committed by GitHub
parent 5708fbbc04
commit 08108ebabb
2 changed files with 38 additions and 1 deletions
+2 -1
View File
@@ -2165,7 +2165,7 @@ processAgentMessageConn vr user@User {userId} corrId agentConnId agentMessage =
in case sndMemberId_ of
-- regular deletion
Nothing
| sameMemberId memberId mem && rcvItemDeletable ci brokerTs ->
| sameMemberId memberId mem && (publicGroupItemDeletable mem || rcvItemDeletable ci brokerTs) ->
delete cci False Nothing
| otherwise ->
messageError "x.msg.del: member attempted invalid message delete" $> Nothing
@@ -2201,6 +2201,7 @@ processAgentMessageConn vr user@User {userId} corrId agentConnId agentMessage =
messageError ("x.msg.del: channel message not found, " <> tshow e) $> Nothing
where
isOwner = maybe True (\m -> memberRole' m == GROwner) m_
publicGroupItemDeletable mem = useRelays' gInfo && memberRole' mem >= GRModerator
RcvMessage {msgId} = rcvMsg
findItem = do
let tryMemberLookup mId =