mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-04-20 04:15:43 +00:00
core: create knocking message for moderators (#5857)
This commit is contained in:
@@ -790,6 +790,10 @@ processAgentMessageConn vr user@User {userId} corrId agentConnId agentMessage =
|
||||
else pure $ memberStatus m
|
||||
(gInfo', m', scopeInfo) <- mkGroupChatScope gInfo m
|
||||
memberConnectedChatItem gInfo' scopeInfo m'
|
||||
case scopeInfo of
|
||||
Just (GCSIMemberSupport _) -> do
|
||||
createInternalChatItem user (CDGroupRcv gInfo' scopeInfo m') (CIRcvGroupEvent RGENewMemberPendingReview) Nothing
|
||||
_ -> pure ()
|
||||
toView $ CRJoinedGroupMember user gInfo' m' {memberStatus = mStatus}
|
||||
let Connection {viaUserContactLink} = conn
|
||||
when (isJust viaUserContactLink && isNothing (memberContactId m')) $ sendXGrpLinkMem gInfo'
|
||||
@@ -2467,6 +2471,10 @@ processAgentMessageConn vr user@User {userId} corrId agentConnId agentMessage =
|
||||
let event = RGEMemberAdded groupMemberId (fromLocalProfile memberProfile)
|
||||
ci <- saveRcvChatItemNoParse user (CDGroupRcv gInfo scopeInfo m) msg brokerTs (CIRcvGroupEvent event)
|
||||
groupMsgToView gInfo scopeInfo ci
|
||||
case scopeInfo of
|
||||
Just (GCSIMemberSupport _) -> do
|
||||
createInternalChatItem user (CDGroupRcv gInfo scopeInfo m) (CIRcvGroupEvent RGENewMemberPendingReview) (Just brokerTs)
|
||||
_ -> pure ()
|
||||
toView $ CRJoinedGroupMemberConnecting user gInfo m announcedMember'
|
||||
getMemNewChatScope announcedMember = case msgScope_ of
|
||||
Nothing -> pure (announcedMember, Nothing)
|
||||
|
||||
@@ -219,6 +219,7 @@ ciRequiresAttention content = case msgDirection @d of
|
||||
RGEInvitedViaGroupLink -> False
|
||||
RGEMemberCreatedContact -> False
|
||||
RGEMemberProfileUpdated {} -> False
|
||||
RGENewMemberPendingReview -> True
|
||||
CIRcvConnEvent _ -> True
|
||||
CIRcvChatFeature {} -> False
|
||||
CIRcvChatPreference {} -> False
|
||||
@@ -332,6 +333,7 @@ rcvGroupEventToText = \case
|
||||
RGEInvitedViaGroupLink -> "invited via your group link"
|
||||
RGEMemberCreatedContact -> "started direct connection with you"
|
||||
RGEMemberProfileUpdated {} -> "updated profile"
|
||||
RGENewMemberPendingReview -> "new member wants to join the group"
|
||||
|
||||
sndGroupEventToText :: SndGroupEvent -> Text
|
||||
sndGroupEventToText = \case
|
||||
|
||||
@@ -31,6 +31,7 @@ data RcvGroupEvent
|
||||
| RGEInvitedViaGroupLink -- CRSentGroupInvitationViaLink
|
||||
| RGEMemberCreatedContact -- CRNewMemberContactReceivedInv
|
||||
| RGEMemberProfileUpdated {fromProfile :: Profile, toProfile :: Profile} -- CRGroupMemberUpdated
|
||||
| RGENewMemberPendingReview
|
||||
deriving (Show)
|
||||
|
||||
data SndGroupEvent
|
||||
|
||||
Reference in New Issue
Block a user