From d64daa7d49b66fda6b4b8a6fe0d65795641afe0e Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Tue, 18 Jul 2017 16:25:38 +0200 Subject: [PATCH] Change avatar via rsapi --- retroshare-qml-app/src/ContactDetails.qml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/retroshare-qml-app/src/ContactDetails.qml b/retroshare-qml-app/src/ContactDetails.qml index 3b0aa4e63..ceed88f29 100644 --- a/retroshare-qml-app/src/ContactDetails.qml +++ b/retroshare-qml-app/src/ContactDetails.qml @@ -44,16 +44,23 @@ Item { console.log("Result file changed! " , resultFile) newAvatar.source = resultFile - } + var base64Image = androidImagePicker.imageToBase64(resultFile) + + rsApi.request("/identity/set_avatar", {"gxs_id": cntDt.md.gxs_id, "avatar": base64Image }, + function (res){ + console.log("Avatar changed! " , JSON.stringify(res)) + } + ) + } } } Image { id: newAvatar - height: colorHash.height - width: colorHash.height + height: topFace.height + width: topFace.height fillMode: Image.PreserveAspectFit }