mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-02-03 11:00:14 -05:00
libresapi: expose identity avatar in JSON API
The avatar is sent as a base64 string The solution is not optimal but is the best we can do inside a JSON and it's acceptable for the moment
This commit is contained in:
parent
0133be757a
commit
b206015e70
@ -22,6 +22,7 @@
|
||||
|
||||
#include <retroshare/rsidentity.h>
|
||||
#include <retroshare/rspeers.h>
|
||||
#include <util/radix64.h>
|
||||
#include <time.h>
|
||||
|
||||
#include "Operators.h"
|
||||
@ -500,6 +501,11 @@ void IdentityHandler::handleGetIdentityDetails(Request& req, Response& resp)
|
||||
|
||||
RsIdentityDetails details;
|
||||
mRsIdentity->getIdDetails(RsGxsId(data.mMeta.mGroupId), details);
|
||||
|
||||
std::string base64Avatar;
|
||||
Radix64::encode(details.mAvatar.mData, details.mAvatar.mSize, base64Avatar);
|
||||
resp.mDataStream << makeKeyValue("avatar", base64Avatar);
|
||||
|
||||
StreamBase& usagesStream = resp.mDataStream.getStreamToMember("usages");
|
||||
usagesStream.getStreamToMember();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user