aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--autotests/testolmaccount.cpp6
-rw-r--r--lib/crypto/qolmaccount.cpp2
2 files changed, 4 insertions, 4 deletions
diff --git a/autotests/testolmaccount.cpp b/autotests/testolmaccount.cpp
index 9195bb62..192c97ac 100644
--- a/autotests/testolmaccount.cpp
+++ b/autotests/testolmaccount.cpp
@@ -300,13 +300,14 @@ void TestOlmAccount::queryTest()
QCOMPARE(aliceRes->oneTimeKeyCounts()["signed_curve25519"], 1);
});
QSignalSpy spy(aliceRes, &BaseJob::result);
- bob->run(aliceRes);
+ alice->run(aliceRes);
QVERIFY(spy.wait(10000));
auto bobOlm = bob->olmAccount();
bobOlm->generateOneTimeKeys(1);
- auto bobRes = aliceOlm->createUploadKeyRequest(aliceOlm->oneTimeKeys());
+ auto bobRes = bobOlm->createUploadKeyRequest(aliceOlm->oneTimeKeys());
connect(bobRes, &BaseJob::result, this, [bobRes] {
+
QCOMPARE(bobRes->oneTimeKeyCounts().size(), 1);
QCOMPARE(bobRes->oneTimeKeyCounts()["signed_curve25519"], 1);
});
@@ -347,7 +348,6 @@ void TestOlmAccount::queryTest()
QVERIFY(bobDevices.size() > 0);
auto devKeys = bobDevices[alice->deviceId()];
- qDebug() << bobDevices.keys();
QCOMPARE(devKeys.userId, alice->userId());
QCOMPARE(devKeys.deviceId, alice->deviceId());
QCOMPARE(devKeys.keys, aliceOlm->deviceKeys().keys);
diff --git a/lib/crypto/qolmaccount.cpp b/lib/crypto/qolmaccount.cpp
index 8cf21045..6b7bc9a9 100644
--- a/lib/crypto/qolmaccount.cpp
+++ b/lib/crypto/qolmaccount.cpp
@@ -253,7 +253,7 @@ UploadKeysJob *QOlmAccount::createUploadKeyRequest(const OneTimeKeys &oneTimeKey
auto temp = signOneTimeKeys(oneTimeKeys);
QHash<QString, QVariant> oneTimeKeysSigned;
for (const auto &[keyId, key] : asKeyValueRange(temp)) {
- oneTimeKeysSigned[keyId] = QVariant::fromValue(key);
+ oneTimeKeysSigned[keyId] = QVariant::fromValue(toJson(key));
}
return new UploadKeysJob(keys, oneTimeKeysSigned);