34 if (! jo.is_object()) { jo = json::object(); }
37 jo[
"userid"s] = pod.
userid;
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);
Definition: jsonwrap.hpp:23
Definition: location.hpp:10
Definition: location.hpp:10
nlohmann::json json
Definition: jsonwrap.hpp:20
Definition: location.hpp:27
JsonWrap fields
Information used to identify this third party location.
Definition: user.hpp:22
std::string protocol
The protocol ID that the third party location is a part of.
Definition: user.hpp:19
std::string userid
A Matrix User ID represting a third party user.
Definition: user.hpp:16
static void from_json(const json &jo, ThirdPartyUser &result)
Definition: user.hpp:44
static void to_json(json &jo, const ThirdPartyUser &pod)
Definition: user.hpp:32