aboutsummaryrefslogtreecommitdiff
path: root/jobs/generated/list_public_rooms.cpp
diff options
context:
space:
mode:
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())