aboutsummaryrefslogtreecommitdiff
path: root/jobs/generated/list_public_rooms.cpp
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2018-02-03 21:24:49 +0900
committerKitsune Ral <Kitsune-Ral@users.sf.net>2018-02-03 21:24:49 +0900
commite80bfd2fc710d4780a2c22bde9d605a41bd4aaa4 (patch)
tree03eecc0f4999f90952da3d7cf8637c2fa2ac84f1 /jobs/generated/list_public_rooms.cpp
parente1aedb9f3dcf7dcdc68e5eefab206258013c5114 (diff)
parentf6b55a3c8fc60dd263954df3359027eff2ef1e18 (diff)
downloadlibquotient-e80bfd2fc710d4780a2c22bde9d605a41bd4aaa4.tar.gz
libquotient-e80bfd2fc710d4780a2c22bde9d605a41bd4aaa4.zip
Merge branch 'kitsune-expose-download-urls' into kitsune-gtad
Diffstat (limited to 'jobs/generated/list_public_rooms.cpp')
-rw-r--r--jobs/generated/list_public_rooms.cpp40
1 files changed, 29 insertions, 11 deletions
diff --git a/jobs/generated/list_public_rooms.cpp b/jobs/generated/list_public_rooms.cpp
index a2c0e406..39653300 100644
--- a/jobs/generated/list_public_rooms.cpp
+++ b/jobs/generated/list_public_rooms.cpp
@@ -66,18 +66,31 @@ class GetPublicRoomsJob::Private
double totalRoomCountEstimate;
};
-GetPublicRoomsJob::GetPublicRoomsJob(double limit, const QString& since, const QString& server)
- : BaseJob(HttpVerb::Get, "GetPublicRoomsJob",
- basePath % "/publicRooms", false)
- , d(new Private)
+BaseJob::Query queryToGetPublicRooms(double limit, const QString& since, const QString& server)
{
- QUrlQuery _q;
+ BaseJob::Query _q;
_q.addQueryItem("limit", QString("%1").arg(limit));
if (!since.isEmpty())
_q.addQueryItem("since", since);
if (!server.isEmpty())
_q.addQueryItem("server", server);
- setRequestQuery(_q);
+ return _q;
+}
+
+QUrl GetPublicRoomsJob::makeRequestUrl(QUrl baseUrl, double limit, const QString& since, const QString& server)
+{
+ return BaseJob::makeRequestUrl(baseUrl,
+ basePath % "/publicRooms",
+ queryToGetPublicRooms(limit, since, server));
+}
+
+GetPublicRoomsJob::GetPublicRoomsJob(double limit, const QString& since, const QString& server)
+ : BaseJob(HttpVerb::Get, "GetPublicRoomsJob",
+ basePath % "/publicRooms",
+ queryToGetPublicRooms(limit, since, server),
+ {}, false)
+ , d(new Private)
+{
}
GetPublicRoomsJob::~GetPublicRoomsJob() = default;
@@ -194,15 +207,20 @@ class QueryPublicRoomsJob::Private
double totalRoomCountEstimate;
};
+BaseJob::Query queryToQueryPublicRooms(const QString& server)
+{
+ BaseJob::Query _q;
+ if (!server.isEmpty())
+ _q.addQueryItem("server", server);
+ return _q;
+}
+
QueryPublicRoomsJob::QueryPublicRoomsJob(const QString& server, double limit, const QString& since, const Filter& filter)
: BaseJob(HttpVerb::Post, "QueryPublicRoomsJob",
- basePath % "/publicRooms")
+ basePath % "/publicRooms",
+ queryToQueryPublicRooms(server))
, d(new Private)
{
- QUrlQuery _q;
- if (!server.isEmpty())
- _q.addQueryItem("server", server);
- setRequestQuery(_q);
QJsonObject _data;
_data.insert("limit", toJson(limit));
if (!since.isEmpty())