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 may increase the db size by a factor of 1000 in the worst case and
it will need some fixes, when we decide to not show some events in the
timeline, but it should work for now.
Mentions are now loaded from the cache instead of
directly from the web request. Mentions are also
properly saved to the cache now (instead of as empty
strings). Still lots of tweaks left on this feature.
Cache user mentions when they are retrieved from the server.
This logic currently isn't being utilized by the UI. Additionally,
the app should use a 'since' value to only get mentions newer
than those stored in the DB, to avoid excessive web requests.
This will be implemented in a future commit.
User colors are now stored in cache. This is consistent
with other similar variables. I think there's a bug
right now where it doesn't properly refresh colors
for the TimeLineItem when the theme is changed.