diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2017-11-16 14:10:08 +0900 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2017-11-16 14:10:08 +0900 |
commit | 491e392af73be3ebfd928e80efc0514fd43b8e87 (patch) | |
tree | b129a00585a19764ef4092fe381c56c4658cd478 /jobs/roommessagesjob.cpp | |
parent | f12e09ea1b45be1a96533aa83f6227940c70d548 (diff) | |
download | libquotient-491e392af73be3ebfd928e80efc0514fd43b8e87.tar.gz libquotient-491e392af73be3ebfd928e80efc0514fd43b8e87.zip |
Simplify code that loads events from JSON arrays
Diffstat (limited to 'jobs/roommessagesjob.cpp')
-rw-r--r-- | jobs/roommessagesjob.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/jobs/roommessagesjob.cpp b/jobs/roommessagesjob.cpp index 078c692a..c527cc71 100644 --- a/jobs/roommessagesjob.cpp +++ b/jobs/roommessagesjob.cpp @@ -58,8 +58,8 @@ QString RoomMessagesJob::end() const BaseJob::Status RoomMessagesJob::parseJson(const QJsonDocument& data) { - QJsonObject obj = data.object(); - d->events.assign(makeEvents<RoomEvent>(obj.value("chunk").toArray())); + const auto obj = data.object(); + d->events.fromJson(obj, "chunk"); d->end = obj.value("end").toString(); return Success; } |