From b2a017303a34e248873b2e47e560a41dc4c5111c Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Mon, 2 Oct 2017 12:16:36 +0900 Subject: All jobs: Drop ConnectionData parameter from the constructor Having to pass ConnectionData to each and every job class was nothing but boilerplate since the very beginning. Removing it required to prepend BaseJob::start() with ConnectionData-setting code, and to provide a way to alter the request configuration depending on the (late-coming) ConnectionData object. This is a new responsibility of BaseJob::start(); the previous BaseJob::start() contents have moved to BaseJob::sendRequest() (which is now invoked on retries, instead of start()). --- jobs/generated/kicking.cpp | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'jobs/generated/kicking.cpp') diff --git a/jobs/generated/kicking.cpp b/jobs/generated/kicking.cpp index 726f6fb0..4f9d6580 100644 --- a/jobs/generated/kicking.cpp +++ b/jobs/generated/kicking.cpp @@ -16,23 +16,14 @@ using namespace QMatrixClient; static const auto basePath = QStringLiteral("/_matrix/client/r0"); - -KickJob::KickJob(const ConnectionData* connection, - QString roomId - , - QString user_id - , - QString reason - ) - : BaseJob(connection, HttpVerb::Post, "KickJob" +KickJob::KickJob(QString roomId, QString user_id, QString reason) + : BaseJob(HttpVerb::Post, "KickJob" , basePath % "/rooms/" % roomId % "/kick" , Query { } , Data { { "user_id", toJson(user_id) }, - { "reason", toJson(reason) } } - ) { } -- cgit v1.2.3