pEp_identity changes nachgezogen. Linkt grad nicht, da in der libpEpEngine.so Code fehlt... oO

refactor-result-recursion
Lars Rohwedder 7 years ago
parent 403edd964f
commit 619f89e2d3

@ -171,6 +171,12 @@ std::size_t from_json<std::size_t>(const js::Value& v)
return v.get_uint64();
}
template<>
bool from_json<bool>(const js::Value& v)
{
return v.get_bool();
}
template<>
js::Value Type2String<std::string>::get() { return "String"; }

@ -47,7 +47,8 @@ const std::string server_version =
// "(5d) Langerwehe"; // add the remaining functions from pEpEngine.h
// "(6) Düren"; // some bug fixes for missing data types, UTF-8 output etc., status in hex etc.
// "(7a) Merzenich"; // InOut parameters added. Untested, yet.
"(7b) Elsdorf"; // add own_key functions, which are new in the pEp Engine
// "(7b) Elsdorf"; // add own_key functions, which are new in the pEp Engine
"(8) Kerpen"; // pEp_identity fixes due to changes in the pEp Engine
template<>

@ -213,6 +213,7 @@ pEp_identity* from_json<pEp_identity*>(const js::Value& v)
char* fingerprint = from_json_object<char*, js::str_type>(o, "fpr");
char* user_id = from_json_object<char*, js::str_type>(o, "user_id");
char* username = from_json_object<char*, js::str_type>(o, "username");
char* lang = from_json_object<char*, js::str_type>(o, "lang");
pEp_identity* ident = new_identity
(
@ -227,6 +228,11 @@ pEp_identity* from_json<pEp_identity*>(const js::Value& v)
free(fingerprint);
free(address);
ident->comm_type = from_json_object<PEP_comm_type, js::int_type>(o, "comm_type");
strncpy(ident->lang, lang, 3);
free(lang);
ident->me = from_json_object<bool, js::bool_type>(o, "me");
return ident;
}
@ -424,7 +430,6 @@ js::Value to_json<pEp_identity*>(pEp_identity* const& id)
js::Object o;
o.emplace_back( "struct_size", js::Value( uint64_t( id->struct_size) ));
to_json_object(o, "address", id->address);
to_json_object(o, "fpr", id->fpr);
to_json_object(o, "user_id", id->user_id);

Loading…
Cancel
Save