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/timeline/TimelineModel.cpp | 3 --- 1 file changed, 3 deletions(-) (limited to 'src/timeline/TimelineModel.cpp') diff --git a/src/timeline/TimelineModel.cpp b/src/timeline/TimelineModel.cpp index 97b95258..d68adf92 100644 --- a/src/timeline/TimelineModel.cpp +++ b/src/timeline/TimelineModel.cpp @@ -173,9 +173,6 @@ TimelineModel::TimelineModel(TimelineViewManager *manager, QString room_id, QObj // mark our messages as read readEvent(event_id.toStdString()); - // ask to be notified for read receipts - cache::addPendingReceipt(room_id_, event_id); - emit dataChanged(index(idx, 0), index(idx, 0)); if (pending.size() > 0) -- cgit 1.5.1