diff options
Diffstat (limited to 'lib/e2ee/qolminboundsession.h')
-rw-r--r-- | lib/e2ee/qolminboundsession.h | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/lib/e2ee/qolminboundsession.h b/lib/e2ee/qolminboundsession.h index 1f5dadd3..437f753d 100644 --- a/lib/e2ee/qolminboundsession.h +++ b/lib/e2ee/qolminboundsession.h @@ -4,12 +4,12 @@ #pragma once -#include <QByteArray> -#include <variant> -#include <memory> -#include "olm/olm.h" -#include "e2ee/qolmerrors.h" #include "e2ee/e2ee.h" +#include "e2ee/qolmerrors.h" +#include "olm/olm.h" + +#include <memory> +#include <variant> namespace Quotient { @@ -20,16 +20,18 @@ class QUOTIENT_API QOlmInboundGroupSession public: ~QOlmInboundGroupSession(); //! Creates a new instance of `OlmInboundGroupSession`. - static std::unique_ptr<QOlmInboundGroupSession> create(const QByteArray &key); + static std::unique_ptr<QOlmInboundGroupSession> create(const QByteArray& key); //! Import an inbound group session, from a previous export. - static std::unique_ptr<QOlmInboundGroupSession> import(const QByteArray &key); + static std::unique_ptr<QOlmInboundGroupSession> import(const QByteArray& key); //! Serialises an `OlmInboundGroupSession` to encrypted Base64. 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 std::variant<std::unique_ptr<QOlmInboundGroupSession>, QOlmError> + unpickle(const QByteArray& picked, const PicklingMode& mode); //! Decrypts ciphertext received for this group session. - std::variant<std::pair<QString, uint32_t>, QOlmError> decrypt(const QByteArray &message); + std::variant<std::pair<QString, uint32_t>, QOlmError> 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); @@ -38,11 +40,11 @@ public: //! Get a base64-encoded identifier for this session. QByteArray sessionId() const; bool isVerified() const; - QOlmInboundGroupSession(OlmInboundGroupSession *session); + + QOlmInboundGroupSession(OlmInboundGroupSession* session); private: - OlmInboundGroupSession *m_groupSession; + OlmInboundGroupSession* m_groupSession; }; using QOlmInboundGroupSessionPtr = std::unique_ptr<QOlmInboundGroupSession>; -using OlmInboundGroupSessionPtr = std::unique_ptr<OlmInboundGroupSession>; } // namespace Quotient |