fix(desktop/contacts) Contacts list not shown
Contacts updates were somehow lost in the base_02 branch, brought back related changes
This commit is contained in:
parent
6c7deb85a0
commit
683e96f276
|
@ -14,7 +14,7 @@ proc getContactById*(id: string): RpcResponse[JsonNode] {.raises: [Exception].}
|
|||
|
||||
proc saveContact*(id: string, ensVerified: bool, ensName: string, alias: string,
|
||||
identicon: string, thumbnail: string, largeImage: string, added: bool,
|
||||
blocked: bool, hasAddedUs: bool, localNickname: string)
|
||||
blocked: bool, hasAddedUs: bool, localNickname: string)
|
||||
{.raises: [Exception].} =
|
||||
let payload = %* [{
|
||||
"id": id,
|
||||
|
@ -23,19 +23,18 @@ proc saveContact*(id: string, ensVerified: bool, ensName: string, alias: string,
|
|||
"alias": alias,
|
||||
"identicon": identicon,
|
||||
"images": {
|
||||
"thumbnail": {"Payload": thumbnail.partition(",")[2]},
|
||||
"large": {"Payload": largeImage.partition(",")[2]}
|
||||
"thumbnail": thumbnail,
|
||||
"large": largeImage
|
||||
},
|
||||
"added": added,
|
||||
"blocked": blocked,
|
||||
"hasAddedUs": hasAddedUs,
|
||||
"localNickname": localNickname
|
||||
}]
|
||||
|
||||
discard callPrivateRPC("saveContact".prefix, payload)
|
||||
#TODO figure out why this causes the app to crash and uncomment
|
||||
#discard callPrivateRPC("saveContact".prefix, payload)
|
||||
|
||||
proc sendContactUpdate*(publicKey, ensName, thumbnail: string)
|
||||
{.raises: [Exception].} =
|
||||
let payload = %* [publicKey, ensName, thumbnail]
|
||||
discard callPrivateRPC("sendContactUpdate".prefix, payload)
|
||||
|
|
@ -13,7 +13,7 @@ proc callRPC*(inputJSON: string): string =
|
|||
proc callPrivateRPCRaw*(inputJSON: string): string {.raises: [].} =
|
||||
result = $status_go.callPrivateRPC(inputJSON)
|
||||
|
||||
proc callPrivateRPC*(methodName: string, payload = %* []): RpcResponse[JsonNode]
|
||||
proc callPrivateRPC*(methodName: string, payload = %* []): RpcResponse[JsonNode]
|
||||
{.raises: [RpcException, ValueError, Defect, SerializationError].} =
|
||||
try:
|
||||
let inputJSON = %* {
|
||||
|
@ -24,7 +24,7 @@ proc callPrivateRPC*(methodName: string, payload = %* []): RpcResponse[JsonNode]
|
|||
debug "NewBE_callPrivateRPC", rpc_method=methodName
|
||||
let rpcResponseRaw = status_go.callPrivateRPC($inputJSON)
|
||||
result = Json.decode(rpcResponseRaw, RpcResponse[JsonNode])
|
||||
|
||||
|
||||
if(not result.error.isNil):
|
||||
var err = "\nstatus-go error ["
|
||||
err &= fmt"methodName:{methodName}, "
|
||||
|
@ -37,7 +37,7 @@ proc callPrivateRPC*(methodName: string, payload = %* []): RpcResponse[JsonNode]
|
|||
except RpcException as e:
|
||||
error "error doing rpc request", methodName = methodName, exception=e.msg
|
||||
raise newException(RpcException, e.msg)
|
||||
|
||||
|
||||
proc signMessage*(rpcParams: string): string =
|
||||
return $status_go.signMessage(rpcParams)
|
||||
|
||||
|
|
Loading…
Reference in New Issue