diff options
author | Hubert Chathi <uhoreg@debian.org> | 2019-06-25 16:33:24 -0400 |
---|---|---|
committer | Hubert Chathi <uhoreg@debian.org> | 2019-06-25 16:33:24 -0400 |
commit | 72d5660efd0755bb53a8699cd39865155400d288 (patch) | |
tree | ed7e7537e6a3eb7e8b92226c4015f9bfc8e11c5a /lib/csapi/list_public_rooms.cpp | |
parent | 52407a933bfe1fcc5f3aa1dccaa0b9a8279aa634 (diff) | |
parent | 681203f951d13e9e8eaf772435cac28c6d74cd42 (diff) | |
download | libquotient-72d5660efd0755bb53a8699cd39865155400d288.tar.gz libquotient-72d5660efd0755bb53a8699cd39865155400d288.zip |
Merge branch 'upstream' (v0.5.2)
Diffstat (limited to 'lib/csapi/list_public_rooms.cpp')
-rw-r--r-- | lib/csapi/list_public_rooms.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/lib/csapi/list_public_rooms.cpp b/lib/csapi/list_public_rooms.cpp index 2fdb2005..71b3c541 100644 --- a/lib/csapi/list_public_rooms.cpp +++ b/lib/csapi/list_public_rooms.cpp @@ -43,7 +43,7 @@ const QString& GetRoomVisibilityOnDirectoryJob::visibility() const BaseJob::Status GetRoomVisibilityOnDirectoryJob::parseJson(const QJsonDocument& data) { auto json = data.object(); - d->visibility = fromJson<QString>(json.value("visibility"_ls)); + fromJson(json.value("visibility"_ls), d->visibility); return Success; } @@ -100,7 +100,7 @@ const PublicRoomsResponse& GetPublicRoomsJob::data() const BaseJob::Status GetPublicRoomsJob::parseJson(const QJsonDocument& data) { - d->data = fromJson<PublicRoomsResponse>(data); + fromJson(data, d->data); return Success; } @@ -108,12 +108,13 @@ namespace QMatrixClient { // Converters - QJsonObject toJson(const QueryPublicRoomsJob::Filter& pod) + template <> struct JsonObjectConverter<QueryPublicRoomsJob::Filter> { - QJsonObject jo; - addParam<IfNotEmpty>(jo, QStringLiteral("generic_search_term"), pod.genericSearchTerm); - return jo; - } + static void dumpTo(QJsonObject& jo, const QueryPublicRoomsJob::Filter& pod) + { + addParam<IfNotEmpty>(jo, QStringLiteral("generic_search_term"), pod.genericSearchTerm); + } + }; } // namespace QMatrixClient class QueryPublicRoomsJob::Private @@ -131,7 +132,7 @@ BaseJob::Query queryToQueryPublicRooms(const QString& server) static const auto QueryPublicRoomsJobName = QStringLiteral("QueryPublicRoomsJob"); -QueryPublicRoomsJob::QueryPublicRoomsJob(const QString& server, Omittable<int> limit, const QString& since, const Omittable<Filter>& filter, bool includeAllNetworks, const QString& thirdPartyInstanceId) +QueryPublicRoomsJob::QueryPublicRoomsJob(const QString& server, Omittable<int> limit, const QString& since, const Omittable<Filter>& filter, Omittable<bool> includeAllNetworks, const QString& thirdPartyInstanceId) : BaseJob(HttpVerb::Post, QueryPublicRoomsJobName, basePath % "/publicRooms", queryToQueryPublicRooms(server)) @@ -155,7 +156,7 @@ const PublicRoomsResponse& QueryPublicRoomsJob::data() const BaseJob::Status QueryPublicRoomsJob::parseJson(const QJsonDocument& data) { - d->data = fromJson<PublicRoomsResponse>(data); + fromJson(data, d->data); return Success; } |