mirror of
https://github.com/status-im/status-go.git
synced 2025-02-18 01:37:22 +00:00
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 {
|
if err != nil {
|
||||||
return err
|
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)
|
m.allChats.Store(chat.ID, chat)
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
@ -85,6 +85,9 @@ func (m *Messenger) AddContact(ctx context.Context, request *requests.AddContact
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
if err := m.saveChat(profileChat); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
// Fetch contact code
|
// Fetch contact code
|
||||||
publicKey, err := contact.PublicKey()
|
publicKey, err := contact.PublicKey()
|
||||||
@ -285,6 +288,7 @@ func (m *Messenger) BlockContact(contact *Contact) ([]*Chat, error) {
|
|||||||
m.allChats.Store(chat.ID, chat)
|
m.allChats.Store(chat.ID, chat)
|
||||||
}
|
}
|
||||||
m.allChats.Delete(contact.ID)
|
m.allChats.Delete(contact.ID)
|
||||||
|
m.allChats.Delete(buildProfileChatID(contact.ID))
|
||||||
|
|
||||||
err = m.syncContact(context.Background(), contact)
|
err = m.syncContact(context.Background(), contact)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user