diff options
author | Tobias Fella <fella@posteo.de> | 2022-03-02 23:56:52 +0100 |
---|---|---|
committer | Tobias Fella <fella@posteo.de> | 2022-03-10 19:50:47 +0100 |
commit | 30004d4e0d6aca06491777f77ed966a451eff50f (patch) | |
tree | c4c7304802f4cd999d628b0263ff58b6cf4e43a8 /lib/e2ee/qolmoutboundsession.h | |
parent | 658e6db49364862be1ab8e264b03dc04a7bed721 (diff) | |
download | libquotient-30004d4e0d6aca06491777f77ed966a451eff50f.tar.gz libquotient-30004d4e0d6aca06491777f77ed966a451eff50f.zip |
Save and load outgoing megolm session
Diffstat (limited to 'lib/e2ee/qolmoutboundsession.h')
-rw-r--r-- | lib/e2ee/qolmoutboundsession.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/e2ee/qolmoutboundsession.h b/lib/e2ee/qolmoutboundsession.h index 32ba2b3b..10ca35c0 100644 --- a/lib/e2ee/qolmoutboundsession.h +++ b/lib/e2ee/qolmoutboundsession.h @@ -25,7 +25,7 @@ public: //! Deserialises from encrypted Base64 that was previously obtained by //! pickling a `QOlmOutboundGroupSession`. static std::variant<std::unique_ptr<QOlmOutboundGroupSession>, QOlmError> - unpickle(QByteArray& pickled, const PicklingMode& mode); + unpickle(const QByteArray& pickled, const PicklingMode& mode); //! Encrypts a plaintext message using the session. std::variant<QByteArray, QOlmError> encrypt(const QString &plaintext); @@ -44,8 +44,16 @@ public: //! ratchet key that will be used for the next message. std::variant<QByteArray, QOlmError> sessionKey() const; QOlmOutboundGroupSession(OlmOutboundGroupSession *groupSession); + + int messageCount() const; + void setMessageCount(int messageCount); + + QDateTime creationTime() const; + void setCreationTime(const QDateTime& creationTime); private: OlmOutboundGroupSession *m_groupSession; + int m_messageCount = 0; + QDateTime m_creationTime = QDateTime::currentDateTime(); }; using QOlmOutboundGroupSessionPtr = std::unique_ptr<QOlmOutboundGroupSession>; |