Fixes https://github.com/vector-im/riot-web/issues/14694
Instead of spending 10-1000ms in a function iterating over a whole lot of room events, we can use our cached state from the Notification State Store.
This commit sets up a structure that could be applied to communities in the TagPanel too, as that could probably use a similar optimization.
This reduces the updateStatusIndicator() time to just 4ms on average.
This was using a separate function (in MatrixChat) that didn't
take into account whether we were supposed to be hiding the badge
for rooms so would include notifs that were hidden everywhere else.
Also make it a function & put it in RoomNotifs with all its friends.
Fixes https://github.com/vector-im/riot-web/issues/3060
* Allow the client to run without connection to HS (i.e. using indexeddb)
Allows running without having pushRules (it's safe not to have these
when running from indexeddb sync.)
This means rooms will be displayed with "unknown" notifcation state.
This assumes anything that uses the push rules will get pushRule state
again when the client starts syncing again.
For recovering from being disconnected,
* If an avatar has fallen back, try again on reconnection
* If a thumbnail image failed to load, retry on reconnect
* Load joined groups when reconnecting
Update tests to give MELS a context.matrixClient
The previous dispatch only did binary muted/non-muted but we now have 4 states. We now just listen for the push rules account data and update on that so it stays in sync if the pishrules are changed elsewhere.
Also add util functions used here for getting the notif state and in vector for both getting and setting it.