mirror of
https://github.com/matrix-org/matrix-spec
synced 2026-03-26 13:04:10 +01:00
Add information on MSC3966: event_property_contains.
This commit is contained in:
parent
c4e64387a2
commit
6339df65ed
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue