aboutsummaryrefslogtreecommitdiff
path: root/lib/connection.cpp
diff options
context:
space:
mode:
authorTobias Fella <fella@posteo.de>2022-05-16 21:26:14 +0200
committerTobias Fella <fella@posteo.de>2022-05-16 21:26:14 +0200
commit89d8f6c44f86a27df28b1d89a80564fb0d4d89fc (patch)
treebcc8051ed04333b4523a1ccc351630f5dba43b79 /lib/connection.cpp
parent6f961ff2726c87e679cc9f6c39ed27a92a31cb0d (diff)
downloadlibquotient-89d8f6c44f86a27df28b1d89a80564fb0d4d89fc.tar.gz
libquotient-89d8f6c44f86a27df28b1d89a80564fb0d4d89fc.zip
Fix build failures
Diffstat (limited to 'lib/connection.cpp')
-rw-r--r--lib/connection.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/connection.cpp b/lib/connection.cpp
index 82046d53..a5615f64 100644
--- a/lib/connection.cpp
+++ b/lib/connection.cpp
@@ -2251,8 +2251,8 @@ QPair<QOlmMessage::Type, QByteArray> Connection::olmEncryptMessage(User* user, c
QOlmMessage::Type type = d->olmSessions[curveKey][0]->encryptMessageType();
auto result = d->olmSessions[curveKey][0]->encrypt(message);
auto pickle = d->olmSessions[curveKey][0]->pickle(picklingMode());
- if (std::holds_alternative<QByteArray>(pickle)) {
- database()->updateOlmSession(curveKey, d->olmSessions[curveKey][0]->sessionId(), std::get<QByteArray>(pickle));
+ if (pickle) {
+ database()->updateOlmSession(curveKey, d->olmSessions[curveKey][0]->sessionId(), *pickle);
} else {
qCWarning(E2EE) << "Failed to pickle olm session.";
}
@@ -2262,12 +2262,12 @@ QPair<QOlmMessage::Type, QByteArray> Connection::olmEncryptMessage(User* user, c
void Connection::createOlmSession(const QString& theirIdentityKey, const QString& theirOneTimeKey)
{
auto session = QOlmSession::createOutboundSession(olmAccount(), theirIdentityKey, theirOneTimeKey);
- if (std::holds_alternative<QOlmError>(session)) {
- qCWarning(E2EE) << "Failed to create olm session for " << theirIdentityKey << std::get<QOlmError>(session);
+ if (!session) {
+ qCWarning(E2EE) << "Failed to create olm session for " << theirIdentityKey << session.error();
return;
}
- d->saveSession(std::get<std::unique_ptr<QOlmSession>>(session), theirIdentityKey);
- d->olmSessions[theirIdentityKey].push_back(std::move(std::get<std::unique_ptr<QOlmSession>>(session)));
+ d->saveSession(**session, theirIdentityKey);
+ d->olmSessions[theirIdentityKey].push_back(std::move(*session));
}
QOlmOutboundGroupSessionPtr Connection::loadCurrentOutboundMegolmSession(Room* room)