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/roommessagesjob.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'jobs/roommessagesjob.cpp') diff --git a/jobs/roommessagesjob.cpp b/jobs/roommessagesjob.cpp index 3e603a50..078c692a 100644 --- a/jobs/roommessagesjob.cpp +++ b/jobs/roommessagesjob.cpp @@ -18,8 +18,6 @@ #include "roommessagesjob.h" -#include "util.h" - using namespace QMatrixClient; class RoomMessagesJob::Private @@ -29,9 +27,9 @@ class RoomMessagesJob::Private QString end; }; -RoomMessagesJob::RoomMessagesJob(const ConnectionData* data, const QString& roomId, - const QString& from, int limit, FetchDirection dir) - : BaseJob(data, HttpVerb::Get, "RoomMessagesJob", +RoomMessagesJob::RoomMessagesJob(const QString& roomId, const QString& from, + int limit, FetchDirection dir) + : BaseJob(HttpVerb::Get, "RoomMessagesJob", QString("/_matrix/client/r0/rooms/%1/messages").arg(roomId), Query( { { "from", from } @@ -53,7 +51,7 @@ RoomEvents RoomMessagesJob::releaseEvents() return d->events.release(); } -QString RoomMessagesJob::end() +QString RoomMessagesJob::end() const { return d->end; } -- cgit v1.2.3