Constructors

Methods

  • Get one of the users push rules by its ID

    Parameters

    • ruleId: string

      The ID of the rule to search for

    Returns null | {
        kind: PushRuleKind;
        rule: IPushRule;
    }

    rule The push rule, or null if no such rule was found

  • Get one of the users push rules by its ID

    Parameters

    • ruleId: string

      The ID of the rule to search for

    Returns null | IPushRule

    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.

    Parameters

    Returns void

  • Convert a list of actions into a object with the actions as keys and their values

    Parameters

    Returns IActionsObject

    A object with key 'notify' (true or false) and an object of actions

    eg. `[ 'notify', { set_tweak: 'sound', value: 'default' } ]`
    becomes `{ notify: true, tweaks: { sound: 'default' } }`
  • Internal

    Parse the key into the separate fields to search by splitting on unescaped ".", and then removing any escape characters.

    Parameters

    • str: string

      The key of the push rule condition: a dotted field.

    Returns string[]

    The unescaped parts to fetch.

  • Rewrites 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.

    Parameters

    • incomingRules: IPushRules

      The client's existing push rules

    • userId: undefined | string = undefined

      The Matrix ID of the client.

    Returns IPushRules

    The rewritten rules