From c2b63a23139aad51c6951692b14571d84c4fc19f Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Wed, 21 Jun 2017 16:31:20 +0200 Subject: [PATCH] Use contacts cache to show contacts details --- retroshare-qml-app/src/Contacts.qml | 1 + .../src/components/AvatarOrColorHash.qml | 16 ++++++---------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/retroshare-qml-app/src/Contacts.qml b/retroshare-qml-app/src/Contacts.qml index 8b3a8f754..418f62bb5 100644 --- a/retroshare-qml-app/src/Contacts.qml +++ b/retroshare-qml-app/src/Contacts.qml @@ -51,6 +51,7 @@ Item { console.log("contactsView.refreshContactsCB()", visible) var token = JSON.parse(par.response).statetoken + ChatCache.contactsCache.contactsList = JSON.parse(par.response).data TokensManager.registerToken(token, refreshContacts) contactsSortWorker.sendMessage( {'action': 'refreshContacts', 'response': par.response}) diff --git a/retroshare-qml-app/src/components/AvatarOrColorHash.qml b/retroshare-qml-app/src/components/AvatarOrColorHash.qml index 0540b4627..04dbda40f 100644 --- a/retroshare-qml-app/src/components/AvatarOrColorHash.qml +++ b/retroshare-qml-app/src/components/AvatarOrColorHash.qml @@ -17,6 +17,7 @@ */ import QtQuick 2.7 +import "../" //Needed for Chat Cache Item @@ -62,16 +63,11 @@ Item function showDetails() { console.log("showDetails() ", gxs_id) - rsApi.request( - "/identity/get_identity_details", - JSON.stringify({ gxs_id: compRoot.gxs_id }), - function(par) - { - var jData = JSON.parse(par.response).data - stackView.push( - "qrc:/ContactDetails.qml", - {md: jData}) - }) + + stackView.push( + "qrc:/ContactDetails.qml", + {md: ChatCache.contactsCache.getContactFromGxsId(gxs_id)}) + } Component.onCompleted: if(visible && !has_avatar) getDetails()