aboutsummaryrefslogtreecommitdiff
path: root/lib/olm/session.h
diff options
context:
space:
mode:
authorCarl Schwan <carl@carlschwan.eu>2021-01-27 15:33:46 +0100
committerTobias Fella <fella@posteo.de>2021-12-01 21:34:52 +0100
commiteabea7af10b5734a507484478a64d2c9f716279f (patch)
tree04abf250636dadd8f639c9c34d0a6af571aa4730 /lib/olm/session.h
parent069602584e0f3ec10a26380af69b95f5da11a8b7 (diff)
downloadlibquotient-eabea7af10b5734a507484478a64d2c9f716279f.tar.gz
libquotient-eabea7af10b5734a507484478a64d2c9f716279f.zip
Add QOlmSession::decrypt
Diffstat (limited to 'lib/olm/session.h')
-rw-r--r--lib/olm/session.h6
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;