diff options
author | Alexey Rusakov <Kitsune-Ral@users.sf.net> | 2022-09-26 15:20:53 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-26 15:20:53 +0200 |
commit | 4c8dcbc308eb0f4900e416e698f5f30e71daaad8 (patch) | |
tree | aa5fdaa81234a21c6919fac4958f84d7c26cd397 /lib/e2ee/qolminboundsession.h | |
parent | 5904a61c59f0eef00aef07ef998658fd791ff139 (diff) | |
parent | 15b840d82d4794358fbf1271ea76e446b47db7e5 (diff) | |
download | libquotient-4c8dcbc308eb0f4900e416e698f5f30e71daaad8.tar.gz libquotient-4c8dcbc308eb0f4900e416e698f5f30e71daaad8.zip |
Merge #571: Unify reporting and handling of Olm errors
Diffstat (limited to 'lib/e2ee/qolminboundsession.h')
-rw-r--r-- | lib/e2ee/qolminboundsession.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/e2ee/qolminboundsession.h b/lib/e2ee/qolminboundsession.h index 1a9b4415..b9710354 100644 --- a/lib/e2ee/qolminboundsession.h +++ b/lib/e2ee/qolminboundsession.h @@ -6,7 +6,7 @@ #include "e2ee/e2ee.h" -#include <olm/olm.h> +struct OlmInboundGroupSession; namespace Quotient { @@ -17,15 +17,15 @@ class QUOTIENT_API QOlmInboundGroupSession public: ~QOlmInboundGroupSession(); //! Creates a new instance of `OlmInboundGroupSession`. - static std::unique_ptr<QOlmInboundGroupSession> create(const QByteArray& key); + static QOlmExpected<QOlmInboundGroupSessionPtr> create(const QByteArray& key); //! Import an inbound group session, from a previous export. - static std::unique_ptr<QOlmInboundGroupSession> import(const QByteArray& key); + static QOlmExpected<QOlmInboundGroupSessionPtr> importSession(const QByteArray& key); //! Serialises an `OlmInboundGroupSession` to encrypted Base64. - QByteArray pickle(const PicklingMode &mode) const; + QByteArray pickle(const PicklingMode& mode) const; //! Deserialises from encrypted Base64 that was previously obtained by pickling //! an `OlmInboundGroupSession`. static QOlmExpected<QOlmInboundGroupSessionPtr> unpickle( - const QByteArray& pickled, const PicklingMode& mode); + QByteArray&& pickled, const PicklingMode& mode); //! Decrypts ciphertext received for this group session. QOlmExpected<std::pair<QByteArray, uint32_t> > decrypt(const QByteArray& message); //! Export the base64-encoded ratchet key for this session, at the given index, @@ -46,6 +46,9 @@ public: QString senderId() const; void setSenderId(const QString& senderId); + OlmErrorCode lastErrorCode() const; + const char* lastError() const; + QOlmInboundGroupSession(OlmInboundGroupSession* session); private: OlmInboundGroupSession* m_groupSession; |