fix: remove rekeying unencrypted communities
This commit is contained in:
parent
ecf493e6cd
commit
783a6b9153
|
@ -1762,7 +1762,6 @@ func (m *Messenger) RemoveUserFromCommunity(id types.HexBytes, pkString string)
|
|||
return response, nil
|
||||
}
|
||||
|
||||
// TODO
|
||||
func (m *Messenger) SendKeyExchangeMessage(communityID []byte, pubkeys []*ecdsa.PublicKey, msgType common.CommKeyExMsgType) error {
|
||||
rawMessage := common.RawMessage{
|
||||
SkipEncryption: false,
|
||||
|
@ -1796,11 +1795,12 @@ func (m *Messenger) BanUserFromCommunity(request *requests.BanUserFromCommunity)
|
|||
return nil, err
|
||||
}
|
||||
|
||||
// TODO generate new encryption key
|
||||
if community.Encrypted() {
|
||||
err = m.SendKeyExchangeMessage(community.ID(), community.GetMemberPubkeys(), common.KeyExMsgRekey)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
response := &MessengerResponse{}
|
||||
response, err = m.DeclineAllPendingGroupInvitesFromUser(response, request.User.String())
|
||||
|
@ -3820,8 +3820,6 @@ func (m *Messenger) UpdateCommunityEncryption(community *communities.Community)
|
|||
becomeMemberPermissions := community.TokenPermissionsByType(protobuf.CommunityTokenPermission_BECOME_MEMBER)
|
||||
isEncrypted := len(becomeMemberPermissions) > 0
|
||||
|
||||
// Check isEncrypted is different to Community's value
|
||||
// If not different return
|
||||
if community.Encrypted() == isEncrypted {
|
||||
return nil, nil
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue