fix: code review

This commit is contained in:
Richard Ramos 2022-02-09 09:07:54 -04:00
parent ae09dfb04b
commit 8c95e65ebf
3 changed files with 8 additions and 6 deletions

View File

@ -38,6 +38,8 @@ const CheckStatusIntervalInMilliseconds = 5000 # 5 seconds, this is timeout how
const OnlineLimitInSeconds = int(5.5 * 60) # 5.5 minutes
const IdleLimitInSeconds = int(7 * 60) # 7 minutes
const identiconURLParam = "identicons?publicKey="
# Signals which may be emitted by this service:
const SIGNAL_ENS_RESOLVED* = "ensResolved"
const SIGNAL_CONTACT_ADDED* = "contactAdded"
@ -181,11 +183,11 @@ QtObject:
return
return status_accounts.generateAlias(publicKey).result.getStr
proc generateIdenticon*(self: Service, publicKey: string): string =
proc generateIdenticonURL*(self: Service, publicKey: string): string =
if(publicKey.len == 0):
error "cannot generate an identicon from the empty public key"
return
return status_accounts.generateIdenticon(publicKey).result.getStr
return
return self.imageServerUrl & identiconURLParam & publicKey
proc getContactById*(self: Service, id: string): ContactsDto =
if(id == singletonInstance.userProfile.getPubKey()):
@ -210,7 +212,7 @@ QtObject:
result = self.fetchContact(id)
if result.id.len == 0:
let alias = self.generateAlias(id)
let identicon = self.imageServerUrl & "identicons?publicKey=" & id
let identicon = self.generateIdenticonURL(id)
result = ContactsDto(
id: id,
identicon: identicon,

View File

@ -47,4 +47,4 @@ proc sendContactUpdate*(publicKey, ensName, thumbnail: string): RpcResponse[Json
proc getImageServerURL*(): RpcResponse[JsonNode] {.raises: [Exception].} =
let payload = %* []
result = callPrivateRPC("imageServerUrl".prefix, payload)
result = callPrivateRPC("imageServerURL".prefix, payload)

@ -1 +1 @@
Subproject commit 7f590c5b0ed2b7f54af2647cd03305eafdbf8888
Subproject commit a47b8fa2eb66f270403121774220001ab0fbd59e