From 46801080846d58ab1528e921bebcb14e651f7956 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Sat, 9 Jun 2018 22:53:29 +0900 Subject: csapi: Now really fix passing query parameters Also: GetContentThumbnailJob (again) requires width and height. --- lib/csapi/definitions/client_device.cpp | 8 ++++---- lib/csapi/definitions/device_keys.cpp | 10 +++++----- lib/csapi/definitions/event_filter.cpp | 10 +++++----- lib/csapi/definitions/push_condition.cpp | 8 ++++---- lib/csapi/definitions/push_rule.cpp | 12 ++++++------ lib/csapi/definitions/push_ruleset.cpp | 10 +++++----- lib/csapi/definitions/room_event_filter.cpp | 6 +++--- lib/csapi/definitions/sync_filter.cpp | 24 ++++++++++++------------ 8 files changed, 44 insertions(+), 44 deletions(-) (limited to 'lib/csapi/definitions') diff --git a/lib/csapi/definitions/client_device.cpp b/lib/csapi/definitions/client_device.cpp index 60b3617c..7c3d7ea6 100644 --- a/lib/csapi/definitions/client_device.cpp +++ b/lib/csapi/definitions/client_device.cpp @@ -9,10 +9,10 @@ using namespace QMatrixClient; QJsonObject QMatrixClient::toJson(const Device& pod) { QJsonObject _json; - addToJson<>(_json, "device_id", pod.deviceId); - addToJson(_json, "display_name", pod.displayName); - addToJson(_json, "last_seen_ip", pod.lastSeenIp); - addToJson(_json, "last_seen_ts", pod.lastSeenTs); + addParam<>(_json, "device_id", pod.deviceId); + addParam(_json, "display_name", pod.displayName); + addParam(_json, "last_seen_ip", pod.lastSeenIp); + addParam(_json, "last_seen_ts", pod.lastSeenTs); return _json; } diff --git a/lib/csapi/definitions/device_keys.cpp b/lib/csapi/definitions/device_keys.cpp index 24357993..43cd5d2e 100644 --- a/lib/csapi/definitions/device_keys.cpp +++ b/lib/csapi/definitions/device_keys.cpp @@ -9,11 +9,11 @@ using namespace QMatrixClient; QJsonObject QMatrixClient::toJson(const DeviceKeys& pod) { QJsonObject _json; - addToJson<>(_json, "user_id", pod.userId); - addToJson<>(_json, "device_id", pod.deviceId); - addToJson<>(_json, "algorithms", pod.algorithms); - addToJson<>(_json, "keys", pod.keys); - addToJson<>(_json, "signatures", pod.signatures); + addParam<>(_json, "user_id", pod.userId); + addParam<>(_json, "device_id", pod.deviceId); + addParam<>(_json, "algorithms", pod.algorithms); + addParam<>(_json, "keys", pod.keys); + addParam<>(_json, "signatures", pod.signatures); return _json; } diff --git a/lib/csapi/definitions/event_filter.cpp b/lib/csapi/definitions/event_filter.cpp index b16b082d..21ee2b81 100644 --- a/lib/csapi/definitions/event_filter.cpp +++ b/lib/csapi/definitions/event_filter.cpp @@ -9,11 +9,11 @@ using namespace QMatrixClient; QJsonObject QMatrixClient::toJson(const Filter& pod) { QJsonObject _json; - addToJson(_json, "limit", pod.limit); - addToJson(_json, "not_senders", pod.notSenders); - addToJson(_json, "not_types", pod.notTypes); - addToJson(_json, "senders", pod.senders); - addToJson(_json, "types", pod.types); + addParam(_json, "limit", pod.limit); + addParam(_json, "not_senders", pod.notSenders); + addParam(_json, "not_types", pod.notTypes); + addParam(_json, "senders", pod.senders); + addParam(_json, "types", pod.types); return _json; } diff --git a/lib/csapi/definitions/push_condition.cpp b/lib/csapi/definitions/push_condition.cpp index 149419f4..b8595ec6 100644 --- a/lib/csapi/definitions/push_condition.cpp +++ b/lib/csapi/definitions/push_condition.cpp @@ -9,10 +9,10 @@ using namespace QMatrixClient; QJsonObject QMatrixClient::toJson(const PushCondition& pod) { QJsonObject _json; - addToJson<>(_json, "kind", pod.kind); - addToJson(_json, "key", pod.key); - addToJson(_json, "pattern", pod.pattern); - addToJson(_json, "is", pod.is); + addParam<>(_json, "kind", pod.kind); + addParam(_json, "key", pod.key); + addParam(_json, "pattern", pod.pattern); + addParam(_json, "is", pod.is); return _json; } diff --git a/lib/csapi/definitions/push_rule.cpp b/lib/csapi/definitions/push_rule.cpp index 3a44a385..98f5d788 100644 --- a/lib/csapi/definitions/push_rule.cpp +++ b/lib/csapi/definitions/push_rule.cpp @@ -9,12 +9,12 @@ using namespace QMatrixClient; QJsonObject QMatrixClient::toJson(const PushRule& pod) { QJsonObject _json; - addToJson<>(_json, "actions", pod.actions); - addToJson<>(_json, "default", pod.isDefault); - addToJson<>(_json, "enabled", pod.enabled); - addToJson<>(_json, "rule_id", pod.ruleId); - addToJson(_json, "conditions", pod.conditions); - addToJson(_json, "pattern", pod.pattern); + addParam<>(_json, "actions", pod.actions); + addParam<>(_json, "default", pod.isDefault); + addParam<>(_json, "enabled", pod.enabled); + addParam<>(_json, "rule_id", pod.ruleId); + addParam(_json, "conditions", pod.conditions); + addParam(_json, "pattern", pod.pattern); return _json; } diff --git a/lib/csapi/definitions/push_ruleset.cpp b/lib/csapi/definitions/push_ruleset.cpp index 98d79248..ca2bbc0d 100644 --- a/lib/csapi/definitions/push_ruleset.cpp +++ b/lib/csapi/definitions/push_ruleset.cpp @@ -9,11 +9,11 @@ using namespace QMatrixClient; QJsonObject QMatrixClient::toJson(const PushRuleset& pod) { QJsonObject _json; - addToJson(_json, "content", pod.content); - addToJson(_json, "override", pod.override); - addToJson(_json, "room", pod.room); - addToJson(_json, "sender", pod.sender); - addToJson(_json, "underride", pod.underride); + addParam(_json, "content", pod.content); + addParam(_json, "override", pod.override); + addParam(_json, "room", pod.room); + addParam(_json, "sender", pod.sender); + addParam(_json, "underride", pod.underride); return _json; } diff --git a/lib/csapi/definitions/room_event_filter.cpp b/lib/csapi/definitions/room_event_filter.cpp index 68e56f4c..1702be22 100644 --- a/lib/csapi/definitions/room_event_filter.cpp +++ b/lib/csapi/definitions/room_event_filter.cpp @@ -9,9 +9,9 @@ using namespace QMatrixClient; QJsonObject QMatrixClient::toJson(const RoomEventFilter& pod) { QJsonObject _json; - addToJson(_json, "not_rooms", pod.notRooms); - addToJson(_json, "rooms", pod.rooms); - addToJson(_json, "contains_url", pod.containsUrl); + addParam(_json, "not_rooms", pod.notRooms); + addParam(_json, "rooms", pod.rooms); + addParam(_json, "contains_url", pod.containsUrl); return _json; } diff --git a/lib/csapi/definitions/sync_filter.cpp b/lib/csapi/definitions/sync_filter.cpp index 7ca389b4..2b5cf8be 100644 --- a/lib/csapi/definitions/sync_filter.cpp +++ b/lib/csapi/definitions/sync_filter.cpp @@ -9,13 +9,13 @@ using namespace QMatrixClient; QJsonObject QMatrixClient::toJson(const RoomFilter& pod) { QJsonObject _json; - addToJson(_json, "not_rooms", pod.notRooms); - addToJson(_json, "rooms", pod.rooms); - addToJson(_json, "ephemeral", pod.ephemeral); - addToJson(_json, "include_leave", pod.includeLeave); - addToJson(_json, "state", pod.state); - addToJson(_json, "timeline", pod.timeline); - addToJson(_json, "account_data", pod.accountData); + addParam(_json, "not_rooms", pod.notRooms); + addParam(_json, "rooms", pod.rooms); + addParam(_json, "ephemeral", pod.ephemeral); + addParam(_json, "include_leave", pod.includeLeave); + addParam(_json, "state", pod.state); + addParam(_json, "timeline", pod.timeline); + addParam(_json, "account_data", pod.accountData); return _json; } @@ -44,11 +44,11 @@ RoomFilter FromJson::operator()(const QJsonValue& jv) QJsonObject QMatrixClient::toJson(const SyncFilter& pod) { QJsonObject _json; - addToJson(_json, "event_fields", pod.eventFields); - addToJson(_json, "event_format", pod.eventFormat); - addToJson(_json, "presence", pod.presence); - addToJson(_json, "account_data", pod.accountData); - addToJson(_json, "room", pod.room); + addParam(_json, "event_fields", pod.eventFields); + addParam(_json, "event_format", pod.eventFormat); + addParam(_json, "presence", pod.presence); + addParam(_json, "account_data", pod.accountData); + addParam(_json, "room", pod.room); return _json; } -- cgit v1.2.3