mirror of
https://github.com/status-im/status-desktop.git
synced 2025-01-27 14:55:44 +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 OnlineLimitInSeconds = int(5.5 * 60) # 5.5 minutes
|
||||||
const IdleLimitInSeconds = int(7 * 60) # 7 minutes
|
const IdleLimitInSeconds = int(7 * 60) # 7 minutes
|
||||||
|
|
||||||
|
const identiconURLParam = "identicons?publicKey="
|
||||||
|
|
||||||
# Signals which may be emitted by this service:
|
# Signals which may be emitted by this service:
|
||||||
const SIGNAL_ENS_RESOLVED* = "ensResolved"
|
const SIGNAL_ENS_RESOLVED* = "ensResolved"
|
||||||
const SIGNAL_CONTACT_ADDED* = "contactAdded"
|
const SIGNAL_CONTACT_ADDED* = "contactAdded"
|
||||||
@ -181,11 +183,11 @@ QtObject:
|
|||||||
return
|
return
|
||||||
return status_accounts.generateAlias(publicKey).result.getStr
|
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):
|
if(publicKey.len == 0):
|
||||||
error "cannot generate an identicon from the empty public key"
|
error "cannot generate an identicon from the empty public key"
|
||||||
return
|
return
|
||||||
return status_accounts.generateIdenticon(publicKey).result.getStr
|
return self.imageServerUrl & identiconURLParam & publicKey
|
||||||
|
|
||||||
proc getContactById*(self: Service, id: string): ContactsDto =
|
proc getContactById*(self: Service, id: string): ContactsDto =
|
||||||
if(id == singletonInstance.userProfile.getPubKey()):
|
if(id == singletonInstance.userProfile.getPubKey()):
|
||||||
@ -210,7 +212,7 @@ QtObject:
|
|||||||
result = self.fetchContact(id)
|
result = self.fetchContact(id)
|
||||||
if result.id.len == 0:
|
if result.id.len == 0:
|
||||||
let alias = self.generateAlias(id)
|
let alias = self.generateAlias(id)
|
||||||
let identicon = self.imageServerUrl & "identicons?publicKey=" & id
|
let identicon = self.generateIdenticonURL(id)
|
||||||
result = ContactsDto(
|
result = ContactsDto(
|
||||||
id: id,
|
id: id,
|
||||||
identicon: identicon,
|
identicon: identicon,
|
||||||
|
@ -47,4 +47,4 @@ proc sendContactUpdate*(publicKey, ensName, thumbnail: string): RpcResponse[Json
|
|||||||
|
|
||||||
proc getImageServerURL*(): RpcResponse[JsonNode] {.raises: [Exception].} =
|
proc getImageServerURL*(): RpcResponse[JsonNode] {.raises: [Exception].} =
|
||||||
let payload = %* []
|
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