summary refs log tree commit diff
path: root/src/Cache_p.h
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2020-04-30 22:42:56 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2020-04-30 22:42:56 +0200
commite6fcccc8bde60c84157e0a3adbae01b87c621b7a (patch)
tree8a10f5e34260acac623951a5d39245050cf06225 /src/Cache_p.h
parentFix spacing of typing notifications (diff)
downloadnheko-e6fcccc8bde60c84157e0a3adbae01b87c621b7a.tar.xz
Don't store pending receipts in cache
We don't get notified for every message. Sometimes we only get a read
receipt for the newest message, which means old read receipts accumulate
in the database. This least to some considerable CPU overhead, when
checking if the timeline should be notified for new read receipts.
Instead just always notify, since that has far less overhead in the
worst case and doesn't need complicated cache cleanup.

The old pending_receipts db is not removed for now. It should still have
minimal storage overhead and we don't have a good mechanism for cache
format upgrades atm.
Diffstat (limited to 'src/Cache_p.h')
-rw-r--r--src/Cache_p.h12
1 files changed, 0 insertions, 12 deletions
diff --git a/src/Cache_p.h b/src/Cache_p.h
index 6eae45a9..982099ea 100644
--- a/src/Cache_p.h
+++ b/src/Cache_p.h
@@ -137,18 +137,6 @@ public:
         using UserReceipts = std::multimap<uint64_t, std::string, std::greater<uint64_t>>;
         UserReceipts readReceipts(const QString &event_id, const QString &room_id);
 
-        //! Filter the events that have at least one read receipt.
-        std::vector<QString> filterReadEvents(const QString &room_id,
-                                              const std::vector<QString> &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(const std::string &room_id);
-        std::vector<QString> 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;
         void saveImage(const std::string &url, const std::string &data);