mirror of
https://github.com/status-im/status-lib.git
synced 2025-01-12 05:24:30 +00:00
fix(@desktop/chat): saveContact method extended with large
image (#45)
Fixes: #3420
This commit is contained in:
parent
9c40da50de
commit
a9b06fde83
@ -23,11 +23,14 @@ proc newContactModel*(events: EventEmitter): ContactModel =
|
|||||||
result.events = events
|
result.events = events
|
||||||
|
|
||||||
proc saveContact(self: ContactModel, contact: Profile): string =
|
proc saveContact(self: ContactModel, contact: Profile): string =
|
||||||
var thumbnail = ""
|
var
|
||||||
|
thumbnail = ""
|
||||||
|
largeImage = ""
|
||||||
if contact.identityImage != nil:
|
if contact.identityImage != nil:
|
||||||
thumbnail = contact.identityImage.thumbnail
|
thumbnail = contact.identityImage.thumbnail
|
||||||
|
largeImage = contact.identityImage.large
|
||||||
|
|
||||||
return status_contacts.saveContact(contact.id, contact.ensVerified, contact.ensName, contact.alias, contact.identicon, thumbnail, contact.systemTags, contact.localNickname)
|
return status_contacts.saveContact(contact.id, contact.ensVerified, contact.ensName, contact.alias, contact.identicon, thumbnail, largeImage, contact.systemTags, contact.localNickname)
|
||||||
|
|
||||||
proc getContactByID*(self: ContactModel, id: string): Profile =
|
proc getContactByID*(self: ContactModel, id: string): Profile =
|
||||||
let response = status_contacts.getContactByID(id)
|
let response = status_contacts.getContactByID(id)
|
||||||
|
@ -41,14 +41,19 @@ proc getContactsIndex*(): (Table[string, Profile], bool)=
|
|||||||
discard getContacts()
|
discard getContacts()
|
||||||
return (contactsIndex, false)
|
return (contactsIndex, false)
|
||||||
|
|
||||||
proc saveContact*(id: string, ensVerified: bool, ensName: string, alias: string, identicon: string, thumbnail: string, systemTags: seq[string], localNickname: string): string =
|
proc saveContact*(id: string, ensVerified: bool, ensName: string, alias: string,
|
||||||
|
identicon: string, thumbnail: string, largeImage: string, systemTags: seq[string],
|
||||||
|
localNickname: string): string =
|
||||||
let payload = %* [{
|
let payload = %* [{
|
||||||
"id": id,
|
"id": id,
|
||||||
"name": ensName,
|
"name": ensName,
|
||||||
"ensVerified": ensVerified,
|
"ensVerified": ensVerified,
|
||||||
"alias": alias,
|
"alias": alias,
|
||||||
"identicon": identicon,
|
"identicon": identicon,
|
||||||
"images": {"thumbnail": {"Payload": thumbnail.partition(",")[2]}},
|
"images": {
|
||||||
|
"thumbnail": {"Payload": thumbnail.partition(",")[2]},
|
||||||
|
"large": {"Payload": largeImage.partition(",")[2]}
|
||||||
|
},
|
||||||
"systemTags": systemTags,
|
"systemTags": systemTags,
|
||||||
"localNickname": localNickname
|
"localNickname": localNickname
|
||||||
}]
|
}]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user