mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Tidy up and move sources
This commit is contained in:
@@ -20,6 +20,8 @@
|
||||
#include <ripple/rpc/impl/Utilities.h>
|
||||
#include <ripple/json/json_value.h>
|
||||
#include <ripple/protocol/JsonFields.h>
|
||||
#include <boost/algorithm/string.hpp>
|
||||
#include <boost/format.hpp>
|
||||
|
||||
namespace ripple {
|
||||
namespace RPC {
|
||||
@@ -65,5 +67,32 @@ addPaymentDeliveredAmount (
|
||||
meta[jss::delivered_amount] = Json::Value ("unavailable");
|
||||
}
|
||||
|
||||
void
|
||||
injectSLE (Json::Value& jv,
|
||||
SLE const& sle)
|
||||
{
|
||||
jv = sle.getJson(0);
|
||||
if (sle.getType() == ltACCOUNT_ROOT)
|
||||
{
|
||||
if (sle.isFieldPresent(sfEmailHash))
|
||||
{
|
||||
auto const& hash =
|
||||
sle.getFieldH128(sfEmailHash);
|
||||
Blob const b (hash.begin(), hash.end());
|
||||
std::string md5 = strHex(makeSlice(b));
|
||||
boost::to_lower(md5);
|
||||
// VFALCO TODO Give a name and move this constant
|
||||
// to a more visible location. Also
|
||||
// shouldn't this be https?
|
||||
jv[jss::urlgravatar] = str(boost::format(
|
||||
"http://www.gravatar.com/avatar/%s") % md5);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
jv[jss::Invalid] = true;
|
||||
}
|
||||
}
|
||||
|
||||
} // ripple
|
||||
} // RPC
|
||||
|
||||
Reference in New Issue
Block a user