mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-04-25 09:52:14 +00:00
core: repeated invite correctly updates role if changed (#1327)
This commit is contained in:
@@ -856,10 +856,11 @@ processChatCommand = \case
|
||||
member <- withStore $ \db -> createNewContactMember db gVar user groupId contact memRole agentConnId cReq
|
||||
sendInvitation member cReq
|
||||
pure $ CRSentGroupInvitation gInfo contact member
|
||||
Just member@GroupMember {groupMemberId, memberStatus}
|
||||
| memberStatus == GSMemInvited ->
|
||||
Just member@GroupMember {groupMemberId, memberStatus, memberRole = mRole}
|
||||
| memberStatus == GSMemInvited -> do
|
||||
unless (mRole == memRole) $ withStore' $ \db -> updateGroupMemberRole db user member memRole
|
||||
withStore' (\db -> getMemberInvitation db user groupMemberId) >>= \case
|
||||
Just cReq -> sendInvitation member cReq $> CRSentGroupInvitation gInfo contact member
|
||||
Just cReq -> sendInvitation member {memberRole = memRole} cReq $> CRSentGroupInvitation gInfo contact member {memberRole = memRole}
|
||||
Nothing -> throwChatError $ CEGroupCantResendInvitation gInfo cName
|
||||
| otherwise -> throwChatError $ CEGroupDuplicateMember cName
|
||||
APIJoinGroup groupId -> withUser $ \user@User {userId} -> do
|
||||
|
||||
Reference in New Issue
Block a user