diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-06-09 22:53:29 +0900 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-06-09 22:53:29 +0900 |
commit | 46801080846d58ab1528e921bebcb14e651f7956 (patch) | |
tree | 13fadd0e947a184bc7cef77c5c0867bf404bfe0b /lib/csapi/search.cpp | |
parent | 6767cb8eccea7b74531f59f165a28afa0bec61f4 (diff) | |
download | libquotient-46801080846d58ab1528e921bebcb14e651f7956.tar.gz libquotient-46801080846d58ab1528e921bebcb14e651f7956.zip |
csapi: Now really fix passing query parameters
Also: GetContentThumbnailJob (again) requires width and height.
Diffstat (limited to 'lib/csapi/search.cpp')
-rw-r--r-- | lib/csapi/search.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/lib/csapi/search.cpp b/lib/csapi/search.cpp index d172dfbe..75748b38 100644 --- a/lib/csapi/search.cpp +++ b/lib/csapi/search.cpp @@ -19,43 +19,43 @@ namespace QMatrixClient QJsonObject toJson(const SearchJob::IncludeEventContext& pod) { QJsonObject _json; - addToJson<IfNotEmpty>(_json, "before_limit", pod.beforeLimit); - addToJson<IfNotEmpty>(_json, "after_limit", pod.afterLimit); - addToJson<IfNotEmpty>(_json, "include_profile", pod.includeProfile); + addParam<IfNotEmpty>(_json, "before_limit", pod.beforeLimit); + addParam<IfNotEmpty>(_json, "after_limit", pod.afterLimit); + addParam<IfNotEmpty>(_json, "include_profile", pod.includeProfile); return _json; } QJsonObject toJson(const SearchJob::Group& pod) { QJsonObject _json; - addToJson<IfNotEmpty>(_json, "key", pod.key); + addParam<IfNotEmpty>(_json, "key", pod.key); return _json; } QJsonObject toJson(const SearchJob::Groupings& pod) { QJsonObject _json; - addToJson<IfNotEmpty>(_json, "group_by", pod.groupBy); + addParam<IfNotEmpty>(_json, "group_by", pod.groupBy); return _json; } QJsonObject toJson(const SearchJob::RoomEventsCriteria& pod) { QJsonObject _json; - addToJson<>(_json, "search_term", pod.searchTerm); - addToJson<IfNotEmpty>(_json, "keys", pod.keys); - addToJson<IfNotEmpty>(_json, "filter", pod.filter); - addToJson<IfNotEmpty>(_json, "order_by", pod.orderBy); - addToJson<IfNotEmpty>(_json, "event_context", pod.eventContext); - addToJson<IfNotEmpty>(_json, "include_state", pod.includeState); - addToJson<IfNotEmpty>(_json, "groupings", pod.groupings); + addParam<>(_json, "search_term", pod.searchTerm); + addParam<IfNotEmpty>(_json, "keys", pod.keys); + addParam<IfNotEmpty>(_json, "filter", pod.filter); + addParam<IfNotEmpty>(_json, "order_by", pod.orderBy); + addParam<IfNotEmpty>(_json, "event_context", pod.eventContext); + addParam<IfNotEmpty>(_json, "include_state", pod.includeState); + addParam<IfNotEmpty>(_json, "groupings", pod.groupings); return _json; } QJsonObject toJson(const SearchJob::Categories& pod) { QJsonObject _json; - addToJson<IfNotEmpty>(_json, "room_events", pod.roomEvents); + addParam<IfNotEmpty>(_json, "room_events", pod.roomEvents); return _json; } @@ -173,7 +173,7 @@ class SearchJob::Private BaseJob::Query queryToSearch(const QString& nextBatch) { BaseJob::Query _q; - addToQuery<IfNotEmpty>(_q, "next_batch", nextBatch); + addParam<IfNotEmpty>(_q, "next_batch", nextBatch); return _q; } @@ -184,7 +184,7 @@ SearchJob::SearchJob(const Categories& searchCategories, const QString& nextBatc , d(new Private) { QJsonObject _data; - addToJson<>(_data, "search_categories", searchCategories); + addParam<>(_data, "search_categories", searchCategories); setRequestData(_data); } |