fix inconsistent contact request state (#3056)
This commit is contained in:
parent
ad67eb52e5
commit
bea710c8be
|
@ -99,6 +99,7 @@ func makeMutualContact(origin *Messenger, contactPubkey *ecdsa.PublicKey) error
|
||||||
}
|
}
|
||||||
contact.Added = true
|
contact.Added = true
|
||||||
contact.HasAddedUs = true
|
contact.HasAddedUs = true
|
||||||
|
contact.ContactRequestState = ContactRequestStateMutual
|
||||||
origin.allContacts.Store(contact.ID, contact)
|
origin.allContacts.Store(contact.ID, contact)
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|
|
@ -219,7 +219,7 @@ func (m *Messenger) checkIfCreatorIsOurContact(group *v1protocol.Group) bool {
|
||||||
creator, err := group.Creator()
|
creator, err := group.Creator()
|
||||||
if err == nil {
|
if err == nil {
|
||||||
contact, _ := m.allContacts.Load(creator)
|
contact, _ := m.allContacts.Load(creator)
|
||||||
return contact != nil && contact.Added && contact.HasAddedUs
|
return contact != nil && contact.ContactRequestState == ContactRequestStateMutual
|
||||||
}
|
}
|
||||||
m.logger.Warn("failed to get creator from group", zap.String("group name", group.Name()), zap.String("group chat id", group.ChatID()), zap.Error(err))
|
m.logger.Warn("failed to get creator from group", zap.String("group name", group.Name()), zap.String("group chat id", group.ChatID()), zap.Error(err))
|
||||||
return false
|
return false
|
||||||
|
|
Loading…
Reference in New Issue