mirror of
https://github.com/status-im/status-desktop.git
synced 2025-01-26 22:39:26 +00:00
fix(Contacts): Use only retractContactRequest
for removing contacts
This commit is contained in:
parent
2160b53e33
commit
eb5423db9c
@ -524,19 +524,16 @@ QtObject:
|
|||||||
self.events.emit(SIGNAL_CONTACT_BLOCKED, ContactArgs(contactId: contact.id))
|
self.events.emit(SIGNAL_CONTACT_BLOCKED, ContactArgs(contactId: contact.id))
|
||||||
|
|
||||||
proc removeContact*(self: Service, publicKey: string) =
|
proc removeContact*(self: Service, publicKey: string) =
|
||||||
var contact = self.getContactById(publicKey)
|
let response = status_contacts.retractContactRequest(publicKey)
|
||||||
|
|
||||||
if contact.added:
|
|
||||||
discard status_contacts.retractContactRequest(publicKey)
|
|
||||||
|
|
||||||
contact.removed = true
|
|
||||||
contact.added = false
|
|
||||||
|
|
||||||
let response = status_contacts.removeContact(contact.id)
|
|
||||||
if(not response.error.isNil):
|
if(not response.error.isNil):
|
||||||
let msg = response.error.message
|
let msg = response.error.message
|
||||||
error "error removing contact ", msg
|
error "error removing contact ", msg
|
||||||
return
|
return
|
||||||
|
|
||||||
|
var contact = self.getContactById(publicKey)
|
||||||
|
contact.removed = true
|
||||||
|
contact.added = false
|
||||||
|
|
||||||
self.saveContact(contact)
|
self.saveContact(contact)
|
||||||
self.events.emit(SIGNAL_CONTACT_REMOVED, ContactArgs(contactId: contact.id))
|
self.events.emit(SIGNAL_CONTACT_REMOVED, ContactArgs(contactId: contact.id))
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user