Go to the documentation of this file.
34 if (! jo.is_object()) { jo = json::object(); }
37 jo[
"userid"s] = pod.userid;
39 jo[
"protocol"s] = pod.protocol;
41 jo[
"fields"s] = pod.fields;
47 if (jo.contains(
"userid"s)) {
48 result.userid = jo.at(
"userid"s);
50 if (jo.contains(
"protocol"s)) {
51 result.protocol = jo.at(
"protocol"s);
53 if (jo.contains(
"fields"s)) {
54 result.fields = jo.at(
"fields"s);
static void from_json(const json &jo, ThirdPartyUser &result)
Definition: user.hpp:44
Definition: location.hpp:26
std::string protocol
The protocol ID that the third party location is a part of.
Definition: user.hpp:23
JsonWrap fields
Information used to identify this third party location.
Definition: user.hpp:26
Definition: location.hpp:10
nlohmann::json json
Definition: jsonwrap.hpp:20
Definition: location.hpp:10
std::string userid
A Matrix User ID represting a third party user.
Definition: user.hpp:20
Definition: jsonwrap.hpp:22
static void to_json(json &jo, const ThirdPartyUser &pod)
Definition: user.hpp:32