diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/connection.cpp | 6 | ||||
-rw-r--r-- | lib/csapi/keys.h | 5 |
2 files changed, 3 insertions, 8 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](){ diff --git a/lib/csapi/keys.h b/lib/csapi/keys.h index b1cc640c..7db09e8d 100644 --- a/lib/csapi/keys.h +++ b/lib/csapi/keys.h @@ -166,11 +166,6 @@ struct JsonObjectConverter<QueryKeysJob::DeviceInformation> { fillFromJson<DeviceKeys>(jo, result); fromJson(jo.value("unsigned"_ls), result.unsignedData); } - static void dumpTo(QJsonObject& jo, const QueryKeysJob::DeviceInformation& deviceInformation) - { - jo = toJson<DeviceKeys>(deviceInformation); - //addParam<>(jo, "unsigned"_ls, deviceInformation.unsignedData); - } }; /*! \brief Claim one-time encryption keys. |