Debian Codegraph @

mtxclient/lib/structs/responses/well-known.cpp

raw symbols SCIP
1 #include "mtx/responses/well-known.hpp"
2
3 #include <nlohmann/json.hpp>
4
5 using json = nlohmann::json;
6
7 namespace mtx {
8 namespace responses {
9
10 void
11 from_json(const json &obj, WellKnown &response)
12 {
13 response.homeserver = obj.at("m.homeserver").get<ServerInformation>();
14
15 if (obj.count("m.identity_server"))
16 response.identity_server = obj.at("m.identity_server").get<ServerInformation>();
17 }
18
19 void
20 from_json(const json &obj, ServerInformation &response)
21 {
22 response.base_url = obj.at("base_url").get<std::string>();
23 }
24 }
25 }