5d5847e4b9
Before we fetched ALL user-statuses with `status=received` (which means that a message hasn't been seen), iterated them, grouped by chat and then stored `message-ids` of these `user-statuses` in chat's `:unviewed-messages` key. This commit introduces :unviewed-messages-count field in chat entity. That means that there is no need to iterate `user-statuses` in order to count a total number of unviewed messages, it is always stored along with chat. In the rest of it, the difference is only that chat's db record should be updated each time when unviewed messages are seen. |
||
---|---|---|
.. | ||
cljsjs | ||
status_im |