aboutsummaryrefslogtreecommitdiff
path: root/lib/connection.cpp
diff options
context:
space:
mode:
authorTobias Fella <9750016+TobiasFella@users.noreply.github.com>2021-12-25 21:51:17 +0100
committerGitHub <noreply@github.com>2021-12-25 21:51:17 +0100
commitff415143b0d953f04a207125e265111b925ce763 (patch)
tree5f3a457afd69e00d37e2928bda65257bc8d20f86 /lib/connection.cpp
parent3164daa6d6cbfb75a1528b2671f5c78422a5539e (diff)
downloadlibquotient-ff415143b0d953f04a207125e265111b925ce763.tar.gz
libquotient-ff415143b0d953f04a207125e265111b925ce763.zip
Apply suggestions from code review
Co-authored-by: Alexey Rusakov <Kitsune-Ral@users.sf.net>
Diffstat (limited to 'lib/connection.cpp')
-rw-r--r--lib/connection.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/connection.cpp b/lib/connection.cpp
index 138f968f..89b80909 100644
--- a/lib/connection.cpp
+++ b/lib/connection.cpp
@@ -112,7 +112,7 @@ public:
#ifdef Quotient_E2EE_ENABLED
QSet<QString> trackedUsers;
QSet<QString> outdatedUsers;
- QHash<QString, QHash<QString, QueryKeysJob::DeviceInformation>> deviceKeys;
+ QHash<QString, QHash<QString, DeviceKeys>> deviceKeys;
QueryKeysJob *currentQueryKeysJob = nullptr;
bool encryptionUpdateRequired = false;
PicklingMode picklingMode = Unencrypted {};
@@ -1975,7 +1975,7 @@ void Connection::Private::saveDevicesList()
}
rootObj.insert(QStringLiteral("tracked_users"), trackedUsersJson);
rootObj.insert(QStringLiteral("outdated_users"), outdatedUsersJson);
- QJsonObject devicesList = toJson<QHash<QString, QHash<QString, QueryKeysJob::DeviceInformation>>>(deviceKeys);
+ const auto devicesList = toJson(deviceKeys);
rootObj.insert(QStringLiteral("devices_list"), devicesList);
rootObj.insert(QStringLiteral("sync_token"), q->nextBatchToken());
}
@@ -2023,7 +2023,7 @@ void Connection::Private::loadDevicesList()
outdatedUsers += user.toString();
}
- deviceKeys = fromJson<QHash<QString, QHash<QString, QueryKeysJob::DeviceInformation>>>(json["devices_list"].toObject());
+ fromJson(json["devices_list"], deviceKeys);
auto oldToken = json["sync_token"].toString();
auto changesJob = q->callApi<GetKeysChangesJob>(oldToken, q->nextBatchToken());
connect(changesJob, &BaseJob::success, q, [this, changesJob](){