diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2017-05-28 13:00:44 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-28 13:00:44 +0900 |
commit | 36dbba9c543b819aec526f18c33f1d95b0ee61c7 (patch) | |
tree | 49caf6450be52072d8f1e4e40e2dfb8490d73732 /jobs/roommessagesjob.cpp | |
parent | ced7a66686596e74a1f25b5d9634b9b562870943 (diff) | |
parent | a5e14da86c3299ca8d36eb4a4eb58ce2a245dc4e (diff) | |
download | libquotient-36dbba9c543b819aec526f18c33f1d95b0ee61c7.tar.gz libquotient-36dbba9c543b819aec526f18c33f1d95b0ee61c7.zip |
Merge pull request #65 from QMatrixClient/kitsune-simplify-events
Events refactoring
Diffstat (limited to 'jobs/roommessagesjob.cpp')
-rw-r--r-- | jobs/roommessagesjob.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/jobs/roommessagesjob.cpp b/jobs/roommessagesjob.cpp index a48403c8..3e603a50 100644 --- a/jobs/roommessagesjob.cpp +++ b/jobs/roommessagesjob.cpp @@ -17,16 +17,15 @@ */ #include "roommessagesjob.h" -#include "../util.h" -#include <QtCore/QJsonArray> +#include "util.h" using namespace QMatrixClient; class RoomMessagesJob::Private { public: - Owning<Events> events; + Owning<RoomEvents> events; QString end; }; @@ -49,7 +48,7 @@ RoomMessagesJob::~RoomMessagesJob() delete d; } -Events RoomMessagesJob::releaseEvents() +RoomEvents RoomMessagesJob::releaseEvents() { return d->events.release(); } @@ -62,7 +61,7 @@ QString RoomMessagesJob::end() BaseJob::Status RoomMessagesJob::parseJson(const QJsonDocument& data) { QJsonObject obj = data.object(); - d->events.assign(eventsFromJson(obj.value("chunk").toArray())); + d->events.assign(makeEvents<RoomEvent>(obj.value("chunk").toArray())); d->end = obj.value("end").toString(); return Success; } |