diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-11-23 15:38:59 +0900 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-11-23 15:55:16 +0900 |
commit | 49ad563550ba9d2d03fc7a519ccb857a6d08791c (patch) | |
tree | c4beac95c51d29c78ca4826898a0d85344769268 /lib/connection.cpp | |
parent | 64799eaf667840c7f81d80810508d948f64f97d6 (diff) | |
download | libquotient-49ad563550ba9d2d03fc7a519ccb857a6d08791c.tar.gz libquotient-49ad563550ba9d2d03fc7a519ccb857a6d08791c.zip |
Room/Connection: don't save the just loaded room cache
Diffstat (limited to 'lib/connection.cpp')
-rw-r--r-- | lib/connection.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/connection.cpp b/lib/connection.cpp index 53835a80..9372acd5 100644 --- a/lib/connection.cpp +++ b/lib/connection.cpp @@ -316,7 +316,7 @@ void Connection::sync(int timeout) }); } -void Connection::onSyncSuccess(SyncData &&data) { +void Connection::onSyncSuccess(SyncData &&data, bool fromCache) { d->data->setLastEvent(data.nextBatch()); for (auto&& roomData: data.takeRoomData()) { @@ -337,7 +337,7 @@ void Connection::onSyncSuccess(SyncData &&data) { } if ( auto* r = provideRoom(roomData.roomId, roomData.joinState) ) { - r->updateData(std::move(roomData)); + r->updateData(std::move(roomData), fromCache); if (d->firstTimeRooms.removeOne(r)) emit loadedRoomState(r); } @@ -1156,7 +1156,7 @@ void Connection::loadState() // TODO: to handle load failures, instead of the above block: // 1. Do initial sync on failed rooms without saving the nextBatch token // 2. Do the sync across all rooms as normal - onSyncSuccess(std::move(sync)); + onSyncSuccess(std::move(sync), true); qCDebug(PROFILER) << "*** Cached state for" << userId() << "loaded in" << et; } |