diff --git a/VERSION b/VERSION index d6dd27387..b4416c95b 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.146.2 +0.146.3 diff --git a/protocol/contact.go b/protocol/contact.go index de9ddea1b..bb50e1c50 100644 --- a/protocol/contact.go +++ b/protocol/contact.go @@ -155,6 +155,7 @@ func (c Contact) PublicKey() (*ecdsa.PublicKey, error) { func (c *Contact) Block(clock uint64) { c.Blocked = true c.DismissContactRequest(clock) + c.Removed = true } func (c *Contact) BlockDesktop() { diff --git a/protocol/messenger_contacts.go b/protocol/messenger_contacts.go index c05ba5320..63528ff3d 100644 --- a/protocol/messenger_contacts.go +++ b/protocol/messenger_contacts.go @@ -669,6 +669,11 @@ func (m *Messenger) blockContact(contactID string, isDesktopFunc bool) ([]*Chat, return nil, err } + err = m.sendRetractContactRequest(contact) + if err != nil { + return nil, err + } + m.allContacts.Store(contact.ID, contact) for _, chat := range chats { m.allChats.Store(chat.ID, chat) diff --git a/protocol/messenger_test.go b/protocol/messenger_test.go index 997d0bd35..4b904bf6e 100644 --- a/protocol/messenger_test.go +++ b/protocol/messenger_test.go @@ -1378,6 +1378,9 @@ func (s *MessengerSuite) TestBlockContact() { response, err := s.m.BlockContact(contact.ID) s.Require().NoError(err) + blockedContacts := s.m.BlockedContacts() + s.Require().True(blockedContacts[0].Removed) + chats := response.Chats() var actualChat2, actualChat3 *Chat