diff options
Diffstat (limited to 'jobs')
-rw-r--r-- | jobs/basejob.cpp | 2 | ||||
-rw-r--r-- | jobs/roommessagesjob.cpp | 7 | ||||
-rw-r--r-- | jobs/roommessagesjob.h | 5 | ||||
-rw-r--r-- | jobs/syncjob.cpp | 3 | ||||
-rw-r--r-- | jobs/syncjob.h | 5 |
5 files changed, 10 insertions, 12 deletions
diff --git a/jobs/basejob.cpp b/jobs/basejob.cpp index e0dff287..20b45a15 100644 --- a/jobs/basejob.cpp +++ b/jobs/basejob.cpp @@ -92,7 +92,7 @@ void BaseJob::start() url.setPath( url.path() + "/" + apiPath() ); QUrlQuery query = this->query(); if( d->needsToken ) - query.addQueryItem("access_token", connection()->token()); + query.addQueryItem("access_token", connection()->accessToken()); url.setQuery(query); QNetworkRequest req = QNetworkRequest(url); req.setHeader(QNetworkRequest::ContentTypeHeader, "application/json"); diff --git a/jobs/roommessagesjob.cpp b/jobs/roommessagesjob.cpp index ba075007..f880713d 100644 --- a/jobs/roommessagesjob.cpp +++ b/jobs/roommessagesjob.cpp @@ -18,7 +18,6 @@ #include "roommessagesjob.h" #include "../room.h" -#include "../events/event.h" #include <QtCore/QJsonObject> #include <QtCore/QJsonArray> @@ -35,7 +34,7 @@ class RoomMessagesJob::Private FetchDirectory dir; int limit; - QList<Event*> events; + Events events; QString end; }; @@ -54,7 +53,7 @@ RoomMessagesJob::~RoomMessagesJob() delete d; } -QList<Event*> RoomMessagesJob::events() +Events RoomMessagesJob::events() { return d->events; } @@ -84,7 +83,7 @@ QUrlQuery RoomMessagesJob::query() const BaseJob::Status RoomMessagesJob::parseJson(const QJsonDocument& data) { QJsonObject obj = data.object(); - d->events = eventListFromJson(obj.value("chunk").toArray()); + d->events = eventsFromJson(obj.value("chunk").toArray()); d->end = obj.value("end").toString(); return Success; } diff --git a/jobs/roommessagesjob.h b/jobs/roommessagesjob.h index 52a72f70..9bedcad9 100644 --- a/jobs/roommessagesjob.h +++ b/jobs/roommessagesjob.h @@ -21,10 +21,11 @@ #include "basejob.h" +#include "../events/event.h" + namespace QMatrixClient { class Room; - class Event; enum class FetchDirectory { Backwards, Forward }; @@ -34,7 +35,7 @@ namespace QMatrixClient RoomMessagesJob(ConnectionData* data, Room* room, QString from, FetchDirectory dir = FetchDirectory::Backwards, int limit=10); virtual ~RoomMessagesJob(); - QList<Event*> events(); + Events events(); QString end(); protected: diff --git a/jobs/syncjob.cpp b/jobs/syncjob.cpp index a9865b55..2b2705b1 100644 --- a/jobs/syncjob.cpp +++ b/jobs/syncjob.cpp @@ -26,7 +26,6 @@ #include "../room.h" #include "../connectiondata.h" -#include "../events/event.h" using namespace QMatrixClient; @@ -139,7 +138,7 @@ BaseJob::Status SyncJob::parseJson(const QJsonDocument& data) void SyncRoomData::EventList::fromJson(const QJsonObject& roomContents) { - auto l = eventListFromJson(roomContents[jsonKey].toObject()["events"].toArray()); + auto l = eventsFromJson(roomContents[jsonKey].toObject()["events"].toArray()); swap(l); } diff --git a/jobs/syncjob.h b/jobs/syncjob.h index f08a6b56..ed99b38b 100644 --- a/jobs/syncjob.h +++ b/jobs/syncjob.h @@ -22,15 +22,14 @@ #include "basejob.h" #include "../joinstate.h" +#include "../events/event.h" namespace QMatrixClient { - class Event; - class SyncRoomData { public: - class EventList : public QList<Event*> + class EventList : public Events { private: QString jsonKey; |