aboutsummaryrefslogtreecommitdiff
path: root/lib/csapi/definitions/wellknown/homeserver.h
diff options
context:
space:
mode:
authorn-peugnet <n.peugnet@free.fr>2022-10-06 19:27:24 +0200
committern-peugnet <n.peugnet@free.fr>2022-10-06 19:27:24 +0200
commitd911b207f49e936b3e992200796110f0749ed150 (patch)
tree96d20ebb4d074a4c1755e21cb316a52d584daee3 /lib/csapi/definitions/wellknown/homeserver.h
parent8ad8a74152c5701b6ca1f9a00487ba9257a439b4 (diff)
parent56c2f2e2b809b9077393eb617828f33d144f5634 (diff)
downloadlibquotient-d911b207f49e936b3e992200796110f0749ed150.tar.gz
libquotient-d911b207f49e936b3e992200796110f0749ed150.zip
New upstream version 0.7.0
Diffstat (limited to 'lib/csapi/definitions/wellknown/homeserver.h')
-rw-r--r--lib/csapi/definitions/wellknown/homeserver.h34
1 files changed, 17 insertions, 17 deletions
diff --git a/lib/csapi/definitions/wellknown/homeserver.h b/lib/csapi/definitions/wellknown/homeserver.h
index 09d6ba63..b7db4182 100644
--- a/lib/csapi/definitions/wellknown/homeserver.h
+++ b/lib/csapi/definitions/wellknown/homeserver.h
@@ -6,23 +6,23 @@
#include "converters.h"
-
-namespace QMatrixClient
-{
- // Data structures
-
- /// Used by clients to discover homeserver information.
- struct HomeserverInformation
+namespace Quotient {
+/// Used by clients to discover homeserver information.
+struct HomeserverInformation {
+ /// The base URL for the homeserver for client-server connections.
+ QUrl baseUrl;
+};
+
+template <>
+struct JsonObjectConverter<HomeserverInformation> {
+ static void dumpTo(QJsonObject& jo, const HomeserverInformation& pod)
{
- /// The base URL for the homeserver for client-server connections.
- QString baseUrl;
- };
-
- QJsonObject toJson(const HomeserverInformation& pod);
-
- template <> struct FromJsonObject<HomeserverInformation>
+ addParam<>(jo, QStringLiteral("base_url"), pod.baseUrl);
+ }
+ static void fillFrom(const QJsonObject& jo, HomeserverInformation& pod)
{
- HomeserverInformation operator()(const QJsonObject& jo) const;
- };
+ fromJson(jo.value("base_url"_ls), pod.baseUrl);
+ }
+};
-} // namespace QMatrixClient
+} // namespace Quotient