aboutsummaryrefslogtreecommitdiff
path: root/lib/connection.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/connection.cpp')
-rw-r--r--lib/connection.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/connection.cpp b/lib/connection.cpp
index 865dff79..f38bb751 100644
--- a/lib/connection.cpp
+++ b/lib/connection.cpp
@@ -652,8 +652,7 @@ void Connection::Private::completeSetup(const QString& mxId)
});
} else {
// account already existing
- auto pickle = database->accountPickle();
- olmAccount->unpickle(pickle, picklingMode);
+ olmAccount->unpickle(database->accountPickle(), picklingMode);
}
#endif // Quotient_E2EE_ENABLED
emit q->stateChanged();
@@ -2300,14 +2299,13 @@ std::pair<QOlmMessage::Type, QByteArray> Connection::Private::olmEncryptMessage(
{
const auto& curveKey = curveKeyForUserDevice(userId, device);
const auto& olmSession = olmSessions.at(curveKey).front();
- QOlmMessage::Type type = olmSession->encryptMessageType();
const auto result = olmSession->encrypt(message);
if (const auto pickle = olmSession->pickle(picklingMode)) {
database->updateOlmSession(curveKey, olmSession->sessionId(), *pickle);
} else {
qWarning(E2EE) << "Failed to pickle olm session: " << pickle.error();
}
- return { type, result.toCiphertext() };
+ return { result.type(), result.toCiphertext() };
}
bool Connection::Private::createOlmSession(const QString& targetUserId,
@@ -2343,7 +2341,7 @@ bool Connection::Private::createOlmSession(const QString& targetUserId,
return false;
}
const auto recipientCurveKey =
- curveKeyForUserDevice(targetUserId, targetDeviceId);
+ curveKeyForUserDevice(targetUserId, targetDeviceId).toLatin1();
auto session =
QOlmSession::createOutboundSession(olmAccount.get(), recipientCurveKey,
signedOneTimeKey->key());