diff options
author | Carl Schwan <carl@carlschwan.eu> | 2021-01-27 15:33:46 +0100 |
---|---|---|
committer | Tobias Fella <fella@posteo.de> | 2021-12-01 21:34:52 +0100 |
commit | eabea7af10b5734a507484478a64d2c9f716279f (patch) | |
tree | 04abf250636dadd8f639c9c34d0a6af571aa4730 /lib/olm/session.h | |
parent | 069602584e0f3ec10a26380af69b95f5da11a8b7 (diff) | |
download | libquotient-eabea7af10b5734a507484478a64d2c9f716279f.tar.gz libquotient-eabea7af10b5734a507484478a64d2c9f716279f.zip |
Add QOlmSession::decrypt
Diffstat (limited to 'lib/olm/session.h')
-rw-r--r-- | lib/olm/session.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/olm/session.h b/lib/olm/session.h index c45b6898..3f1622c7 100644 --- a/lib/olm/session.h +++ b/lib/olm/session.h @@ -32,7 +32,11 @@ public: static std::variant<std::unique_ptr<QOlmSession>, OlmError> unpickle(QByteArray &pickled, const PicklingMode &mode); //! Encrypts a plaintext message using the session. Message encrypt(const QString &plaintext); - // TODO: WiP + + //! Decrypts a message using this session. Decoding is lossy, meaing if + //! the decrypted plaintext contains invalid UTF-8 symbols, they will + //! be returned as `U+FFFD` (�). + std::variant<QString, OlmError> decrypt(const Message &message) const; //! Get a base64-encoded identifier for this session. QByteArray sessionId() const; |