Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MSC3930: Polls push rules/notifications #3930

Merged
merged 10 commits into from
Aug 21, 2023
Prev Previous commit
Next Next commit
Use modern push rule practices
  • Loading branch information
turt2live committed Jun 1, 2023
commit 70576b912ef8fea7be05a77052a0de8c911d27ff
27 changes: 17 additions & 10 deletions proposals/3930-polls-notifications.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,16 @@ Note that [order matters](https://github.com/matrix-org/matrix-spec/issues/1406)
underride rules are to be inserted immediately after the `.m.rule.encrypted` underride push rule, in the
order presented by this MSC.

```json
```jsonc
{
"rule_id": ".m.rule.poll_start_one_to_one",
"default": true,
"enabled": true,
"conditions": [
{"kind": "room_member_count", "is": "2"},
{"kind": "event_match", "key": "type", "pattern": "m.poll.start"}

// Note: `.` is escaped once, but for valid JSON we need to escape the escape.
{"kind": "event_property_is", "key": "type", "pattern": "m\\.poll\\.start"}
],
"actions": [
"notify",
Expand All @@ -34,28 +36,31 @@ order presented by this MSC.
}
```

```json
```jsonc
{
"rule_id": ".m.rule.poll_start",
"default": true,
"enabled": true,
"conditions": [
{"kind": "event_match", "key": "type", "pattern": "m.poll.start"}
// Note: `.` is escaped once, but for valid JSON we need to escape the escape.
{"kind": "event_property_is", "key": "type", "pattern": "m\\.poll\\.start"}
],
"actions": [
"notify"
]
}
```

```json
```jsonc
{
"rule_id": ".m.rule.poll_end_one_to_one",
"default": true,
"enabled": true,
"conditions": [
{"kind": "room_member_count", "is": "2"},
{"kind": "event_match", "key": "type", "pattern": "m.poll.end"}

// Note: `.` is escaped once, but for valid JSON we need to escape the escape.
{"kind": "event_property_is", "key": "type", "pattern": "m\\.poll\\.end"}
],
"actions": [
"notify",
Expand All @@ -64,13 +69,14 @@ order presented by this MSC.
}
```

```json
```jsonc
{
"rule_id": ".m.rule.poll_end",
"default": true,
"enabled": true,
"conditions": [
{"kind": "event_match", "key": "type", "pattern": "m.poll.end"}
// Note: `.` is escaped once, but for valid JSON we need to escape the escape.
{"kind": "event_property_is", "key": "type", "pattern": "m\\.poll\\.end"}
],
"actions": [
"notify"
Expand All @@ -81,13 +87,14 @@ order presented by this MSC.
Additionally, a new override rule is defined to suppress poll responses by default, inserted immediately
after the `.m.rule.room.server_acl` override rule.

```json
```jsonc
{
"rule_id": ".m.rule.poll_response",
"default": true,
"enabled": true,
"conditions": [
{"kind": "event_match", "key": "type", "pattern": "m.poll.response"}
// Note: `.` is escaped once, but for valid JSON we need to escape the escape.
{"kind": "event_property_is", "key": "type", "value": "m\\.poll\\.response"}
],
"actions": []
}
Expand Down