aboutsummaryrefslogtreecommitdiff
path: root/lib/database.h
diff options
context:
space:
mode:
authorTobias Fella <fella@posteo.de>2022-03-08 22:35:56 +0100
committerTobias Fella <fella@posteo.de>2022-03-08 22:35:56 +0100
commit01f7641292eb5dff236f434d7140259c429521ca (patch)
treecc5a94463a918e399887bf006741b08397af5945 /lib/database.h
parentce32dc09a9257ce5cb3188879f549d9b2fa816a1 (diff)
downloadlibquotient-01f7641292eb5dff236f434d7140259c429521ca.tar.gz
libquotient-01f7641292eb5dff236f434d7140259c429521ca.zip
Store time of last decrypted message for each olm session
Is required to correctly choose a session to use for sending messages
Diffstat (limited to 'lib/database.h')
-rw-r--r--lib/database.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/database.h b/lib/database.h
index f9a8df1a..cf241dbc 100644
--- a/lib/database.h
+++ b/lib/database.h
@@ -27,13 +27,14 @@ public:
QByteArray accountPickle();
void setAccountPickle(const QByteArray &pickle);
void clear();
- void saveOlmSession(const QString& senderKey, const QString& sessionId, const QByteArray &pickle);
+ void saveOlmSession(const QString& senderKey, const QString& sessionId, const QByteArray &pickle, const QDateTime& timestamp);
UnorderedMap<QString, std::vector<QOlmSessionPtr>> loadOlmSessions(const PicklingMode& picklingMode);
UnorderedMap<std::pair<QString, QString>, QOlmInboundGroupSessionPtr> loadMegolmSessions(const QString& roomId, const PicklingMode& picklingMode);
void saveMegolmSession(const QString& roomId, const QString& senderKey, const QString& sessionKey, const QString& ed25519Key, const QByteArray& pickle);
void addGroupSessionIndexRecord(const QString& roomId, const QString& sessionId, uint32_t index, const QString& eventId, qint64 ts);
std::pair<QString, qint64> groupSessionIndexRecord(const QString& roomId, const QString& sessionId, qint64 index);
void clearRoomData(const QString& roomId);
+ void setOlmSessionLastReceived(const QString& sessionId, const QDateTime& timestamp);
private:
void migrateTo1();