fix: removeTrustStatus response processing (#15206)

This commit is contained in:
Igor Sirotin 2024-06-18 11:08:30 +01:00 committed by GitHub
parent 067f406572
commit eb9c629bbf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 10 additions and 5 deletions

View File

@ -474,8 +474,10 @@ QtObject:
self.events.emit(signal, ContactArgs(contactId: publicKey))
proc parseContactsResponse*(self: Service, response: RpcResponse[JsonNode]) =
if response.result["contacts"] != nil:
for contactJson in response.result["contacts"]:
let contacts = response.result{"contacts"}
if contacts == nil:
return
for contactJson in contacts:
self.updateContact(contactJson.toContactsDto())
proc sendContactRequest*(self: Service, publicKey: string, message: string) =
@ -720,7 +722,10 @@ QtObject:
return
self.parseContactsResponse(response)
self.parseContactsResponse(response)
if self.contacts.hasKey(publicKey):
self.contacts[publicKey].dto.trustStatus = TrustStatus.Unknown
self.events.emit(SIGNAL_REMOVED_TRUST_STATUS, TrustArgs(publicKey: publicKey, isUntrustworthy: false))
except Exception as e:
error "error in removeTrustStatus request", msg = e.msg