From e4dedbcaba544b8cd9b7fea20ece4dad262b2c34 Mon Sep 17 00:00:00 2001 From: Konstantinos Sideris Date: Tue, 17 Jul 2018 23:50:18 +0300 Subject: Mark own read messages with a double checkmark (#377) --- src/Cache.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/Cache.h') diff --git a/src/Cache.h b/src/Cache.h index fa8355a5..d5d1729e 100644 --- a/src/Cache.h +++ b/src/Cache.h @@ -347,6 +347,18 @@ public: using UserReceipts = std::multimap>; UserReceipts readReceipts(const QString &event_id, const QString &room_id); + //! Filter the events that have at least one read receipt. + std::vector filterReadEvents(const QString &room_id, + const std::vector &event_ids, + const std::string &excluded_user); + //! Add event for which we are expecting some read receipts. + void addPendingReceipt(const QString &room_id, const QString &event_id); + void removePendingReceipt(lmdb::txn &txn, + const std::string &room_id, + const std::string &event_id); + void notifyForReadReceipts(lmdb::txn &txn, const std::string &room_id); + std::vector pendingReceiptsEvents(lmdb::txn &txn, const std::string &room_id); + QByteArray image(const QString &url) const; QByteArray image(lmdb::txn &txn, const std::string &url) const; QByteArray image(const std::string &url) const @@ -421,6 +433,9 @@ public: OlmSessionStorage session_storage; +signals: + void newReadReceipts(const QString &room_id, const std::vector &event_ids); + private: //! Save an invited room. void saveInvite(lmdb::txn &txn, @@ -582,6 +597,11 @@ private: } } + lmdb::dbi getPendingReceiptsDb(lmdb::txn &txn) + { + return lmdb::dbi::open(txn, "pending_receipts", MDB_CREATE); + } + lmdb::dbi getMessagesDb(lmdb::txn &txn, const std::string &room_id) { auto db = -- cgit 1.5.1