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/notifications.cpp | |
parent | 4b1b308f28bdaef598a5dfc249d7af6a0346b367 (diff) | |
download | libquotient-6767cb8eccea7b74531f59f165a28afa0bec61f4.tar.gz libquotient-6767cb8eccea7b74531f59f165a28afa0bec61f4.zip |
csapi: Fix boolean query parameters incorrectly passed
Diffstat (limited to 'lib/csapi/notifications.cpp')
-rw-r--r-- | lib/csapi/notifications.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/csapi/notifications.cpp b/lib/csapi/notifications.cpp index 9329857d..de5b41f2 100644 --- a/lib/csapi/notifications.cpp +++ b/lib/csapi/notifications.cpp @@ -50,12 +50,9 @@ class GetNotificationsJob::Private BaseJob::Query queryToGetNotifications(const QString& from, Omittable<int> limit, const QString& only) { BaseJob::Query _q; - if (!from.isEmpty()) - _q.addQueryItem("from", from); - if (limit) - _q.addQueryItem("limit", QString("%1").arg(limit.value())); - if (!only.isEmpty()) - _q.addQueryItem("only", only); + addToQuery<IfNotEmpty>(_q, "from", from); + addToQuery<IfNotEmpty>(_q, "limit", limit); + addToQuery<IfNotEmpty>(_q, "only", only); return _q; } |