The Matrix client object to use
Get one of the users push rules by its ID
The ID of the rule to search for
rule The push rule, or null if no such rule was found
Get one of the users push rules by its ID
The ID of the rule to search for
The push rule, or null if no such rule was found
Pre-caches the parsed keys for push rules and cleans out any obsolete cache entries. Should be called after push rules are updated.
The new push rules.
Static
actionConvert a list of actions into a object with the actions as keys and their values
The actions list
A object with key 'notify' (true or false) and an object of actions
Static
getCreate a RegExp object for the given glob pattern with a single capture group around the pattern itself, caching the result. No cache invalidation is present currently, as this will be inherently bounded to the size of the user's own push rules.
the glob pattern to convert to a RegExp
whether to align the pattern to word boundaries,
as specified for content.body
matches, will use lookaround assertions to ensure the match only includes the pattern
the flags to pass to the RegExp constructor, defaults to case-insensitive
Static
partsInternal
Parse the key into the separate fields to search by splitting on unescaped ".", and then removing any escape characters.
The key of the push rule condition: a dotted field.
The unescaped parts to fetch.
Static
rewriteRewrites conditions on a client's push rules to match the defaults where applicable. Useful for upgrading push rules to more strict conditions when the server is falling behind on defaults.
The client's existing push rules
The Matrix ID of the client.
The rewritten rules
Construct a Push Processor.