From de9448a65655451e1310947955dd6b341479dc23 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Wed, 8 Mar 2017 20:22:44 +0900 Subject: Connection::callApi<>, a factory for all API call jobs This call (intended to only be used within the lib) creates a job object of the passed type and passes a ConnectionData pointer to its constructor. This allows to avoid making a switchboard of methods on Connection for the whole API, leaving only those that naturally belong there - e.g. joinRoom() or sync() - and moving, e.g., postMessage() to where it belongs - Room. PostMessageJob and RoomMessagesJob were updated along the way, to unbind from the Room class (which they really don't and won't need). --- jobs/roommessagesjob.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'jobs/roommessagesjob.h') diff --git a/jobs/roommessagesjob.h b/jobs/roommessagesjob.h index fd6a131d..af7d65df 100644 --- a/jobs/roommessagesjob.h +++ b/jobs/roommessagesjob.h @@ -24,15 +24,14 @@ namespace QMatrixClient { - class Room; - - enum class FetchDirectory { Backwards, Forward }; + enum class FetchDirection { Backward, Forward }; class RoomMessagesJob: public BaseJob { public: - RoomMessagesJob(ConnectionData* data, Room* room, QString from, - FetchDirectory dir = FetchDirectory::Backwards, int limit=10); + RoomMessagesJob(ConnectionData* data, QString roomId, + QString from, int limit = 10, + FetchDirection dir = FetchDirection::Backward); virtual ~RoomMessagesJob(); Events releaseEvents(); -- cgit v1.2.3