fix(contacts): retract the contact request when removing a contact
Fixes #7791 Adds the retractContactRequest status-go api call. Calling it when removing a contact makes sure to send a signal to that other user so they can understand that we are no longer mutual contacts or don't have a request anymore
This commit is contained in:
parent
a69b3b5928
commit
ed4ecb17bb
|
@ -490,6 +490,10 @@ QtObject:
|
||||||
|
|
||||||
proc removeContact*(self: Service, publicKey: string) =
|
proc removeContact*(self: Service, publicKey: string) =
|
||||||
var contact = self.getContactById(publicKey)
|
var contact = self.getContactById(publicKey)
|
||||||
|
|
||||||
|
if contact.added:
|
||||||
|
discard status_contacts.retractContactRequest(publicKey)
|
||||||
|
|
||||||
contact.removed = true
|
contact.removed = true
|
||||||
contact.added = false
|
contact.added = false
|
||||||
|
|
||||||
|
|
|
@ -102,3 +102,9 @@ proc getReceivedVerificationRequests*(): RpcResponse[JsonNode] {.raises: [Except
|
||||||
proc cancelVerificationRequest*(pubkey: string): RpcResponse[JsonNode] {.raises: [Exception].} =
|
proc cancelVerificationRequest*(pubkey: string): RpcResponse[JsonNode] {.raises: [Exception].} =
|
||||||
let payload = %* [pubkey]
|
let payload = %* [pubkey]
|
||||||
result = callPrivateRPC("cancelVerificationRequest".prefix, payload)
|
result = callPrivateRPC("cancelVerificationRequest".prefix, payload)
|
||||||
|
|
||||||
|
proc retractContactRequest*(pubkey: string): RpcResponse[JsonNode] {.raises: [Exception].} =
|
||||||
|
let payload = %*[{
|
||||||
|
"contactId": pubkey
|
||||||
|
}]
|
||||||
|
result = callPrivateRPC("retractContactRequest".prefix, payload)
|
||||||
|
|
Loading…
Reference in New Issue