aboutsummaryrefslogtreecommitdiff
path: root/lib/csapi/definitions/wellknown/homeserver.h
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2020-06-09 08:52:25 +0200
committerGitHub <noreply@github.com>2020-06-09 08:52:25 +0200
commit370d9b3e46332d38df8798cda208c534c58be808 (patch)
treef3db0cd7463468ff52c74446acd608356f8b8ab6 /lib/csapi/definitions/wellknown/homeserver.h
parente1f5d0aa2c33e6da6c3a609c8bc7e0b5867e748d (diff)
parent10d9ac4673e374a9ac17ff492591136520337c4c (diff)
downloadlibquotient-370d9b3e46332d38df8798cda208c534c58be808.tar.gz
libquotient-370d9b3e46332d38df8798cda208c534c58be808.zip
Merge pull request #405 from quotient-im/kitsune-basejob-store-json-response
Store JSON response in BaseJob + tweaks to the generated code
Diffstat (limited to 'lib/csapi/definitions/wellknown/homeserver.h')
-rw-r--r--lib/csapi/definitions/wellknown/homeserver.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/csapi/definitions/wellknown/homeserver.h b/lib/csapi/definitions/wellknown/homeserver.h
index 7607c8b5..5cfaca24 100644
--- a/lib/csapi/definitions/wellknown/homeserver.h
+++ b/lib/csapi/definitions/wellknown/homeserver.h
@@ -7,9 +7,6 @@
#include "converters.h"
namespace Quotient {
-
-// Data structures
-
/// Used by clients to discover homeserver information.
struct HomeserverInformation {
/// The base URL for the homeserver for client-server connections.
@@ -18,8 +15,14 @@ struct HomeserverInformation {
template <>
struct JsonObjectConverter<HomeserverInformation> {
- static void dumpTo(QJsonObject& jo, const HomeserverInformation& pod);
- static void fillFrom(const QJsonObject& jo, HomeserverInformation& pod);
+ static void dumpTo(QJsonObject& jo, const HomeserverInformation& pod)
+ {
+ addParam<>(jo, QStringLiteral("base_url"), pod.baseUrl);
+ }
+ static void fillFrom(const QJsonObject& jo, HomeserverInformation& pod)
+ {
+ fromJson(jo.value("base_url"_ls), pod.baseUrl);
+ }
};
} // namespace Quotient