Class PushRules
Push rules: the server-default rule set and the evaluation of a rule set against an event.
Inherited Members
Namespace: Uniform.Matrix.Protocol.Server
Assembly: Uniform.Matrix.Protocol.Server.dll
Syntax
public static class PushRules
Remarks
Rules are JSON as clients see them in m.push_rules: kinds override, content, room, sender and underride, tried in that order; the first enabled rule that matches decides.
Properties
| Edit this page View SourceKinds
Kinds in evaluation order.
Declaration
public static IReadOnlyList<string> Kinds { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyList<string> |
Methods
| Edit this page View SourceDefaults(string)
Return the server-default rule set of userId, as in the spec's predefined rules.
Declaration
public static JsonObject Defaults(string userId)
Parameters
| Type | Name | Description |
|---|---|---|
| string | userId |
Returns
| Type | Description |
|---|---|
| JsonObject |
Evaluate(JsonObject, JsonObject, PushContext)
Return what ruleset decides for clientEvent: the actions of the first enabled rule that matches.
Declaration
public static PushDecision Evaluate(JsonObject ruleset, JsonObject clientEvent, PushContext context)
Parameters
| Type | Name | Description |
|---|---|---|
| JsonObject | ruleset | Rules by kind, as in |
| JsonObject | clientEvent | The event in client format, with |
| PushContext | context | The user and the room. |
Returns
| Type | Description |
|---|---|
| PushDecision |