Commit Graph

27 Commits (d6d09227530da472ba5ecd9de99c32891ed9e82c)

Author SHA1 Message Date
menturion 56456b84e8 Call "MatrixClientPeg.get()" only once in method "findOverrideMuteRule" 2020-12-16 18:16:15 +01:00
Travis Ralston dd16ec070c Replace countRoomsWithNotif with a dedicated NotificationState
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.
2020-07-21 20:24:44 -06:00
Michael Telatynski 61618d5162 tidy up
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-06-25 15:02:52 +01:00
Travis Ralston 042bd35d79 Fix MatrixClientPeg imports 2019-12-22 21:15:54 -07:00
Travis Ralston 806d728d59 Import from the js-sdk's src/ directory
Because ES6 and such.
2019-12-22 21:14:33 -07:00
Travis Ralston be4eeb5e07 Fix js-sdk imports for new module 2019-12-22 21:10:26 -07:00
Michael Telatynski d4d51dc61f Rip out the remainder of Bluebird 2019-11-18 10:03:05 +00:00
David Baker 2247c5953d Fix conflicting PRs 2019-06-19 13:33:06 +01:00
David Baker 86081c3c8f
Merge pull request #3120 from matrix-org/dbkr/badges_remove_dupe_code
De-duplicate notif badge code
2019-06-19 13:30:04 +01:00
David Baker 23b29ce3f5 Use the variables we just defined above 2019-06-19 12:12:19 +01:00
David Baker edd43a2706 Fix favicon/title badge count
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
2019-06-19 12:06:32 +01:00
David Baker 0e6f401b62 copyright 2019-06-19 11:48:47 +01:00
David Baker c57d93702a De-duplicate notif badge code
We had two different places we were deciding whether to show a badge.
Let's just have one.
2019-06-19 11:46:24 +01:00
Travis Ralston f5600fd4d7 Add badges to breadcrumb rooms
Fixes https://github.com/vector-im/riot-web/issues/8606
2019-04-03 15:29:15 -06:00
Bruno Windels 7b367e267b move sublist badge aggregation code to RoomNotifs to reuse for tags/comm 2019-02-06 10:51:29 +00:00
Luke Barnard cf4ae681f4
Offline mode (#1723)
* 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
2018-02-06 17:50:53 +00:00
Richard van der Hoff 0d7cc59d99 replace q method calls with bluebird ones
```
find src test -name '*.js' |
    xargs perl -i -pe 's/q\.(all|defer|reject|delay|try|isFulfilled)\(/Promise.$1(/'
```
2017-07-12 18:05:40 +01:00
Richard van der Hoff a06bd84213 replace imports of `q` with bluebird
update `package.json`

```
find src test -name '*.js' |
   xargs perl -i -pe 'if (/require\(.[qQ].\)/) { $_ = "import Promise from '\''bluebird'\'';\n"; }'

find src test -name '*.js' |
   xargs perl -i -pe 'if (/import [qQ]/) { $_ = "import Promise from '\''bluebird'\'';\n"; }'
```
2017-07-12 18:05:08 +01:00
Michael Telatynski b98c105dcc
de-lint Skinner, RoomNotifs
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2017-07-01 14:28:12 +01:00
David Baker 18d4d3392a Fix a bunch of linting errors
eslint --fix and a few manual ones
2017-01-20 14:22:27 +00:00
Matthew Hodgson 1bc26cb6c5 fix guest access; broken since Aug 18 2016-09-01 16:58:37 +01:00
David Baker 5495cfaca9 Only try to delete room rule if it exists 2016-08-18 16:59:25 +01:00
David Baker d08f716681 Comment override rule stuff 2016-08-18 15:21:46 +01:00
David Baker bab2f23db3 Oops, missed a constant 2016-08-18 15:18:02 +01:00
David Baker af48b8920e Various PR feedback 2016-08-18 14:00:14 +01:00
David Baker 9e45279894 Use enumalike thing 2016-08-18 13:44:58 +01:00
David Baker 87f94bde62 Fix up notification setting listener in roomtile
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.
2016-08-17 18:26:37 +01:00