mirror of
https://github.com/status-im/status-desktop.git
synced 2025-01-13 15:55:18 +00:00
fix: code review
This commit is contained in:
parent
ae09dfb04b
commit
8c95e65ebf
@ -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 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,
|
||||
|
@ -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)
|
||||
|
2
vendor/nim-status-go
vendored
2
vendor/nim-status-go
vendored
@ -1 +1 @@
|
||||
Subproject commit 7f590c5b0ed2b7f54af2647cd03305eafdbf8888
|
||||
Subproject commit a47b8fa2eb66f270403121774220001ab0fbd59e
|
Loading…
x
Reference in New Issue
Block a user