From 6339df65eddcd172add9be8eb31b041047be0159 Mon Sep 17 00:00:00 2001 From: Patrick Cloke Date: Tue, 14 Mar 2023 09:22:42 -0400 Subject: [PATCH] Add information on MSC3966: event_property_contains. --- content/client-server-api/modules/push.md | 44 +++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/content/client-server-api/modules/push.md b/content/client-server-api/modules/push.md index 91e893fc..1bf0343a 100644 --- a/content/client-server-api/modules/push.md +++ b/content/client-server-api/modules/push.md @@ -337,6 +337,50 @@ The following `m.federate` values will NOT match: * `1` (do not cast types) {{% /boxes/note %}} +**`event_property_contains`** + +This matches if an array property of an event exactly contains a value. Parameters: + +- `key`: The dot-separated path of the property of the event to match, e.g. + `content.body`. + +- `value`: The value to match against. + +The array values are matched exactly and only supports strings, integers, booleans, +and `null`. Array values not of those types are ignored. + +If the property specified by `key` is completely absent from the event, or is not +an array, then the condition will not match. + +{{% boxes/note %}} +For example, if `key` is `content.alt_aliases`, and `value` is `"#myroom:example.com"`, +then the following event will match: + +```json +{ + "content": { + "alias": "#somewhere:localhost", + "alt_aliases": [ + "#somewhere:example.org", + "#myroom:example.com" + ] + }, + "event_id": "$143273582443PhrSn:example.org", + "origin_server_ts": 1432735824653, + "room_id": "!jEsUZKDJdhlrceRyVU:example.org", + "sender": "@example:example.org", + "state_key": "", + "type": "m.room.canonical_alias", + "unsigned": { + "age": 1234 + } +} +``` + +The following `alt_aliases` values will NOT match: + * `":example.com"` (partial values do not match) +{{% /boxes/note %}} + **`contains_display_name`** This matches messages where `content.body` contains the owner's display name in