aboutsummaryrefslogtreecommitdiff
path: root/lib/syncdata.cpp
diff options
context:
space:
mode:
authorAlexey Rusakov <Kitsune-Ral@users.sf.net>2021-11-17 19:37:20 +0100
committerGitHub <noreply@github.com>2021-11-17 19:37:20 +0100
commitd02a6ffc90d0d2a7984560ec28241be228014fac (patch)
tree4a2a869a2ce437ba17c7269e8e904276a11db62a /lib/syncdata.cpp
parentd5515bb6dd8ebf46aa36a8bc696b90a573a8492c (diff)
parent0052c0b2b4f9860ee9223ef161f40929e7c4c454 (diff)
downloadlibquotient-d02a6ffc90d0d2a7984560ec28241be228014fac.tar.gz
libquotient-d02a6ffc90d0d2a7984560ec28241be228014fac.zip
Merge pull request #487 from quotient-im/kitsune-fix-read-receipts-and-markers
Distinguish between read receipts and the fully read marker
Diffstat (limited to 'lib/syncdata.cpp')
-rw-r--r--lib/syncdata.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/syncdata.cpp b/lib/syncdata.cpp
index 4edc9564..e86d3100 100644
--- a/lib/syncdata.cpp
+++ b/lib/syncdata.cpp
@@ -103,7 +103,7 @@ SyncData::SyncData(const QString& cacheFileName)
{
QFileInfo cacheFileInfo { cacheFileName };
auto json = loadJson(cacheFileName);
- auto requiredVersion = std::get<0>(cacheVersion());
+ auto requiredVersion = MajorCacheVersion;
auto actualVersion =
json.value("cache_version"_ls).toObject().value("major"_ls).toInt();
if (actualVersion == requiredVersion)
@@ -128,6 +128,11 @@ Events&& SyncData::takeAccountData() { return std::move(accountData); }
Events&& SyncData::takeToDeviceEvents() { return std::move(toDeviceEvents); }
+std::pair<int, int> SyncData::cacheVersion()
+{
+ return { MajorCacheVersion, 1 };
+}
+
QJsonObject SyncData::loadJson(const QString& fileName)
{
QFile roomFile { fileName };