From e6fcccc8bde60c84157e0a3adbae01b87c621b7a Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Thu, 30 Apr 2020 22:42:56 +0200 Subject: 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. --- src/Cache.h | 15 --------------- 1 file changed, 15 deletions(-) (limited to 'src/Cache.h') diff --git a/src/Cache.h b/src/Cache.h index bb042ea9..99c63550 100644 --- a/src/Cache.h +++ b/src/Cache.h @@ -154,21 +154,6 @@ 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(const std::string &room_id); -std::vector -pendingReceiptsEvents(lmdb::txn &txn, const std::string &room_id); - QByteArray image(const QString &url); QByteArray -- cgit 1.5.1