diff --git a/src/Simplex/Chat/Library/Subscriber.hs b/src/Simplex/Chat/Library/Subscriber.hs index 682a3bc75d..aefabd3c0c 100644 --- a/src/Simplex/Chat/Library/Subscriber.hs +++ b/src/Simplex/Chat/Library/Subscriber.hs @@ -3210,6 +3210,9 @@ processAgentMessageConn cxt user@User {userId} corrId agentConnId agentMessage = messageError "x.grp.mem.role with insufficient member permissions" $> Nothing | useRelays' gInfo && (isRosterRole memRole || isRosterRole fromRole) && senderRole /= GROwner = messageError "x.grp.mem.role: only the owner can change member, moderator and admin roles in relay groups" $> Nothing + -- in channels the owner-signed roster delivers role changes to subscribers; a forwarded + -- x.grp.mem.role landing after the roster already applied the role is a no-op, suppress it + | useRelays' gInfo && fromRole == memRole = pure $ memberEventDeliveryScope member | otherwise = do withStore' $ \db -> updateGroupMemberRole db user member memRole (gInfo'', m', scopeInfo) <- mkGroupChatScope gInfo' m diff --git a/tests/ChatTests/Groups.hs b/tests/ChatTests/Groups.hs index 1cf6ebfe4b..13d169f0cf 100644 --- a/tests/ChatTests/Groups.hs +++ b/tests/ChatTests/Groups.hs @@ -8889,7 +8889,6 @@ testChannelsSenderDeduplicateOwn ps = do ] cath <### [ EndsWith "updated to dan", - "#team: member role did not change", "#team: bob introduced dan (Daniel) in the channel", WithTime "#team> 1 [>>]", WithTime "#team> 2 [>>]", @@ -8898,7 +8897,6 @@ testChannelsSenderDeduplicateOwn ps = do ] dan <### [ EndsWith "updated to cath", - "#team: member role did not change", "#team: bob introduced cath (Catherine) in the channel", WithTime "#team> 1 [>>]", WithTime "#team> 2 [>>]", @@ -8909,8 +8907,6 @@ testChannelsSenderDeduplicateOwn ps = do eve <### [ EndsWith "updated to cath", EndsWith "updated to dan", - "#team: member role did not change", - "#team: member role did not change", "#team: bob introduced cath (Catherine) in the channel", "#team: bob introduced dan (Daniel) in the channel", WithTime "#team> 1 [>>]", @@ -9081,21 +9077,17 @@ testChannelMultipleLargeProfiles ps = ] cath <### [ EndsWith "updated to dan", - "#team: member role did not change", "#team: bob introduced dan (Daniel) in the channel", WithTime "#team dan> from dan [>>]" ] dan <### [ EndsWith "updated to cath", - "#team: member role did not change", "#team: bob introduced cath (Catherine) in the channel", WithTime "#team cath> from cath [>>]" ] eve <### [ EndsWith "updated to cath", EndsWith "updated to dan", - "#team: member role did not change", - "#team: member role did not change", "#team: bob introduced dan (Daniel) in the channel", "#team: bob introduced cath (Catherine) in the channel", WithTime "#team cath> from cath [>>]",