diff options
author | Alexey Rusakov <Kitsune-Ral@users.sf.net> | 2022-05-16 17:38:34 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-16 17:38:34 +0200 |
commit | 77b190d822c1e980b98b84999f0cfb609ed05a49 (patch) | |
tree | 049fc3936343a7af957c0bca20dd1531ae2e5f81 /lib/e2ee/qolminboundsession.h | |
parent | 0599ef6e603dce219b2ba000d7322e8d937753b9 (diff) | |
parent | decc676f1e469dc26c80c33da64fad15805de8f2 (diff) | |
download | libquotient-77b190d822c1e980b98b84999f0cfb609ed05a49.tar.gz libquotient-77b190d822c1e980b98b84999f0cfb609ed05a49.zip |
Merge #550: Quotient::Expected and QOlmExpected
Diffstat (limited to 'lib/e2ee/qolminboundsession.h')
-rw-r--r-- | lib/e2ee/qolminboundsession.h | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/lib/e2ee/qolminboundsession.h b/lib/e2ee/qolminboundsession.h index 13515434..1a9b4415 100644 --- a/lib/e2ee/qolminboundsession.h +++ b/lib/e2ee/qolminboundsession.h @@ -5,11 +5,8 @@ #pragma once #include "e2ee/e2ee.h" -#include "e2ee/qolmerrors.h" -#include "olm/olm.h" -#include <memory> -#include <variant> +#include <olm/olm.h> namespace Quotient { @@ -27,14 +24,13 @@ public: QByteArray pickle(const PicklingMode &mode) const; //! Deserialises from encrypted Base64 that was previously obtained by pickling //! an `OlmInboundGroupSession`. - static std::variant<std::unique_ptr<QOlmInboundGroupSession>, QOlmError> - unpickle(const QByteArray& picked, const PicklingMode& mode); + static QOlmExpected<QOlmInboundGroupSessionPtr> unpickle( + const QByteArray& pickled, const PicklingMode& mode); //! Decrypts ciphertext received for this group session. - std::variant<std::pair<QString, uint32_t>, QOlmError> decrypt( - const QByteArray& message); + QOlmExpected<std::pair<QByteArray, uint32_t> > decrypt(const QByteArray& message); //! Export the base64-encoded ratchet key for this session, at the given index, //! in a format which can be used by import. - std::variant<QByteArray, QOlmError> exportSession(uint32_t messageIndex); + QOlmExpected<QByteArray> exportSession(uint32_t messageIndex); //! Get the first message index we know how to decrypt. uint32_t firstKnownIndex() const; //! Get a base64-encoded identifier for this session. |