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.
This commit is contained in:
Nicolas Werner 2020-04-30 22:42:56 +02:00
parent 2997155f56
commit e6fcccc8bd
4 changed files with 7 additions and 170 deletions

View file

@ -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)