Save profile chat
This commit is contained in:
parent
54b3689814
commit
7fc812b693
|
@ -406,7 +406,7 @@ func (m *Messenger) saveChat(chat *Chat) error {
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
// TODO(samyoul) remove storing of an updated reference pointer?
|
||||
// We store the chat has it might not have been in the store in the first place
|
||||
m.allChats.Store(chat.ID, chat)
|
||||
|
||||
return nil
|
||||
|
|
|
@ -85,6 +85,9 @@ func (m *Messenger) AddContact(ctx context.Context, request *requests.AddContact
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := m.saveChat(profileChat); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// Fetch contact code
|
||||
publicKey, err := contact.PublicKey()
|
||||
|
@ -285,6 +288,7 @@ func (m *Messenger) BlockContact(contact *Contact) ([]*Chat, error) {
|
|||
m.allChats.Store(chat.ID, chat)
|
||||
}
|
||||
m.allChats.Delete(contact.ID)
|
||||
m.allChats.Delete(buildProfileChatID(contact.ID))
|
||||
|
||||
err = m.syncContact(context.Background(), contact)
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in New Issue