From 6767cb8eccea7b74531f59f165a28afa0bec61f4 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Fri, 8 Jun 2018 23:24:51 +0900 Subject: csapi: Fix boolean query parameters incorrectly passed --- lib/csapi/list_public_rooms.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'lib/csapi/list_public_rooms.cpp') diff --git a/lib/csapi/list_public_rooms.cpp b/lib/csapi/list_public_rooms.cpp index f104786b..5952fd6e 100644 --- a/lib/csapi/list_public_rooms.cpp +++ b/lib/csapi/list_public_rooms.cpp @@ -100,12 +100,9 @@ class GetPublicRoomsJob::Private BaseJob::Query queryToGetPublicRooms(Omittable limit, const QString& since, const QString& server) { BaseJob::Query _q; - if (limit) - _q.addQueryItem("limit", QString("%1").arg(limit.value())); - if (!since.isEmpty()) - _q.addQueryItem("since", since); - if (!server.isEmpty()) - _q.addQueryItem("server", server); + addToQuery(_q, "limit", limit); + addToQuery(_q, "since", since); + addToQuery(_q, "server", server); return _q; } @@ -213,8 +210,7 @@ class QueryPublicRoomsJob::Private BaseJob::Query queryToQueryPublicRooms(const QString& server) { BaseJob::Query _q; - if (!server.isEmpty()) - _q.addQueryItem("server", server); + addToQuery(_q, "server", server); return _q; } -- cgit v1.2.3