mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-03 06:35:08 -04:00
Create avatar cache and identity details cache
This commit is contained in:
parent
36708efa8c
commit
53eadfdc19
2 changed files with 55 additions and 17 deletions
|
@ -101,6 +101,8 @@ QtObject
|
|||
id: contactsCache
|
||||
property var contactsList
|
||||
property var own
|
||||
property var identityDetails: ({})
|
||||
|
||||
|
||||
function getContactFromGxsId (gxsId)
|
||||
{
|
||||
|
@ -109,10 +111,29 @@ QtObject
|
|||
{
|
||||
if (contactsList[i].gxs_id == gxsId) return contactsList[i]
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
function getIdentityDetails (gxsId)
|
||||
{
|
||||
if (identityDetails[gxsId]) return identityDetails[gxsId]
|
||||
return ""
|
||||
}
|
||||
|
||||
function setIdentityDetails (jData)
|
||||
{
|
||||
identityDetails[jData.gxs_id] = jData
|
||||
}
|
||||
|
||||
function getIdentityAvatar (gxsId)
|
||||
{
|
||||
|
||||
if (identityDetails[gxsId] && identityDetails[gxsId].avatar !== undefined)
|
||||
{
|
||||
return identityDetails[gxsId].avatar
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue