diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2017-10-02 12:16:36 +0900 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2017-10-13 10:37:16 +0200 |
commit | b2a017303a34e248873b2e47e560a41dc4c5111c (patch) | |
tree | 2745b5d555b7689a448b6800503f6ff3f8201265 /jobs/generated | |
parent | c9dc5e12b835425f1ba5c447ddb3c3394ccac93e (diff) | |
download | libquotient-b2a017303a34e248873b2e47e560a41dc4c5111c.tar.gz libquotient-b2a017303a34e248873b2e47e560a41dc4c5111c.zip |
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()).
Diffstat (limited to 'jobs/generated')
-rw-r--r-- | jobs/generated/inviting.cpp | 18 | ||||
-rw-r--r-- | jobs/generated/inviting.h | 10 | ||||
-rw-r--r-- | jobs/generated/kicking.cpp | 13 | ||||
-rw-r--r-- | jobs/generated/kicking.h | 12 |
4 files changed, 9 insertions, 44 deletions
diff --git a/jobs/generated/inviting.cpp b/jobs/generated/inviting.cpp index e5e7f410..1e0c29a3 100644 --- a/jobs/generated/inviting.cpp +++ b/jobs/generated/inviting.cpp @@ -16,19 +16,11 @@ using namespace QMatrixClient; static const auto basePath = QStringLiteral("/_matrix/client/r0"); - -InviteUserJob::InviteUserJob(const ConnectionData* connection, - QString roomId - , - QString user_id - ) - : BaseJob(connection, HttpVerb::Post, "InviteUserJob" - , basePath % "/rooms/" % roomId % "/invite" - , Query { } - , Data { - { "user_id", toJson(user_id) } - } - +InviteUserJob::InviteUserJob(QString roomId, QString user_id) + : BaseJob(HttpVerb::Post, "InviteUserJob", + basePath % "/rooms/" % roomId % "/invite", + Query {}, + Data { { "user_id", toJson(user_id) } } ) { } diff --git a/jobs/generated/inviting.h b/jobs/generated/inviting.h index af5a426d..84cce06e 100644 --- a/jobs/generated/inviting.h +++ b/jobs/generated/inviting.h @@ -27,15 +27,7 @@ namespace QMatrixClient class InviteUserJob : public BaseJob { public: - InviteUserJob(const ConnectionData* connection - - , - QString roomId - - , - QString user_id - ); - + InviteUserJob(QString roomId, QString user_id); }; 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) } } - ) { } diff --git a/jobs/generated/kicking.h b/jobs/generated/kicking.h index 7b183b08..a746db8b 100644 --- a/jobs/generated/kicking.h +++ b/jobs/generated/kicking.h @@ -27,17 +27,7 @@ namespace QMatrixClient class KickJob : public BaseJob { public: - KickJob(const ConnectionData* connection - - , - QString roomId - - , - QString user_id - - , - QString reason - ); + KickJob(QString roomId, QString user_id, QString reason); }; |