You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-28 05:03:59 +03:00
Cache the joined member count for a room state
Pushrule evaluation needs the count of joined room members and filtering the list for joined members takes a nontrivial amount of time, but caching it is trivial, both code and memory wise.
This commit is contained in:
@@ -156,9 +156,7 @@ function PushProcessor(client) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const memberCount = Object.keys(room.currentState.members).filter(function(m) {
|
||||
return room.currentState.members[m].membership == 'join';
|
||||
}).length;
|
||||
const memberCount = room.currentState.getJoinedMemberCount();
|
||||
|
||||
const m = cond.is.match(/^([=<>]*)([0-9]*)$/);
|
||||
if (!m) {
|
||||
|
||||
Reference in New Issue
Block a user