diff options
author | Tobias Fella <fella@posteo.de> | 2022-03-02 23:56:52 +0100 |
---|---|---|
committer | Tobias Fella <fella@posteo.de> | 2022-03-10 19:50:47 +0100 |
commit | 30004d4e0d6aca06491777f77ed966a451eff50f (patch) | |
tree | c4c7304802f4cd999d628b0263ff58b6cf4e43a8 /lib/connection.cpp | |
parent | 658e6db49364862be1ab8e264b03dc04a7bed721 (diff) | |
download | libquotient-30004d4e0d6aca06491777f77ed966a451eff50f.tar.gz libquotient-30004d4e0d6aca06491777f77ed966a451eff50f.zip |
Save and load outgoing megolm session
Diffstat (limited to 'lib/connection.cpp')
-rw-r--r-- | lib/connection.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/connection.cpp b/lib/connection.cpp index 88c61530..d01b8ac4 100644 --- a/lib/connection.cpp +++ b/lib/connection.cpp @@ -2193,7 +2193,6 @@ bool Connection::hasOlmSession(User* user, const QString& deviceId) const QPair<QOlmMessage::Type, QByteArray> Connection::olmEncryptMessage(User* user, const QString& device, const QByteArray& message) { //TODO be smarter about choosing a session; see e2ee impl guide - //TODO create session? const auto& curveKey = curveKeyForUserDevice(user->id(), device); QOlmMessage::Type type = d->olmSessions[curveKey][0]->encryptMessageType(); auto result = d->olmSessions[curveKey][0]->encrypt(message); @@ -2212,4 +2211,14 @@ void Connection::createOlmSession(const QString& theirIdentityKey, const QString d->olmSessions[theirIdentityKey].push_back(std::move(std::get<std::unique_ptr<QOlmSession>>(session))); } +QOlmOutboundGroupSessionPtr Connection::loadCurrentOutboundMegolmSession(Room* room) +{ + return d->database->loadCurrentOutboundMegolmSession(room->id(), d->picklingMode); +} + +void Connection::saveCurrentOutboundMegolmSession(Room *room, const QOlmOutboundGroupSessionPtr& data) +{ + d->database->saveCurrentOutboundMegolmSession(room->id(), d->picklingMode, data); +} + #endif |