diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-02-26 09:07:16 +0900 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-02-26 09:07:16 +0900 |
commit | 91cc0e8db0006beeb91b9e007cd21343984dfb6a (patch) | |
tree | 7a79286d7c6e5a99644c3f7141e1cdc8e2459416 /jobs/syncjob.cpp | |
parent | e77a53946805649be99f8c0f6ee9c00702348132 (diff) | |
parent | ec412621d71b1a7758b15d2b3c5cd5e7b2081ab1 (diff) | |
download | libquotient-91cc0e8db0006beeb91b9e007cd21343984dfb6a.tar.gz libquotient-91cc0e8db0006beeb91b9e007cd21343984dfb6a.zip |
Merge branch 'kitsune-account-data'
Diffstat (limited to 'jobs/syncjob.cpp')
-rw-r--r-- | jobs/syncjob.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/jobs/syncjob.cpp b/jobs/syncjob.cpp index ce5dd894..7b066f4f 100644 --- a/jobs/syncjob.cpp +++ b/jobs/syncjob.cpp @@ -54,6 +54,11 @@ SyncDataList&& SyncData::takeRoomData() return std::move(roomData); } +SyncBatch<Event>&& SyncData::takeAccountData() +{ + return std::move(accountData); +} + BaseJob::Status SyncJob::parseJson(const QJsonDocument& data) { return d.parseJson(data); @@ -63,12 +68,12 @@ BaseJob::Status SyncData::parseJson(const QJsonDocument &data) { QElapsedTimer et; et.start(); - QJsonObject json = data.object(); + auto json { data.object() }; nextBatch_ = json.value("next_batch").toString(); // TODO: presence - // TODO: account_data - QJsonObject rooms = json.value("rooms").toObject(); + accountData.fromJson(json); + QJsonObject rooms = json.value("rooms").toObject(); for (size_t i = 0; i < JoinStateStrings.size(); ++i) { const auto rs = rooms.value(JoinStateStrings[i]).toObject(); |