diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-06-08 23:24:51 +0900 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-06-08 23:24:51 +0900 |
commit | 6767cb8eccea7b74531f59f165a28afa0bec61f4 (patch) | |
tree | ea3ffe2fc07d3a9b7b48ee2ab37b0fe594f1af85 /lib/csapi/peeking_events.cpp | |
parent | 4b1b308f28bdaef598a5dfc249d7af6a0346b367 (diff) | |
download | libquotient-6767cb8eccea7b74531f59f165a28afa0bec61f4.tar.gz libquotient-6767cb8eccea7b74531f59f165a28afa0bec61f4.zip |
csapi: Fix boolean query parameters incorrectly passed
Diffstat (limited to 'lib/csapi/peeking_events.cpp')
-rw-r--r-- | lib/csapi/peeking_events.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/csapi/peeking_events.cpp b/lib/csapi/peeking_events.cpp index 884abe00..53f2d280 100644 --- a/lib/csapi/peeking_events.cpp +++ b/lib/csapi/peeking_events.cpp @@ -23,12 +23,9 @@ class PeekEventsJob::Private BaseJob::Query queryToPeekEvents(const QString& from, Omittable<int> timeout, const QString& roomId) { BaseJob::Query _q; - if (!from.isEmpty()) - _q.addQueryItem("from", from); - if (timeout) - _q.addQueryItem("timeout", QString("%1").arg(timeout.value())); - if (!roomId.isEmpty()) - _q.addQueryItem("room_id", roomId); + addToQuery<IfNotEmpty>(_q, "from", from); + addToQuery<IfNotEmpty>(_q, "timeout", timeout); + addToQuery<IfNotEmpty>(_q, "room_id", roomId); return _q; } |