From 6b02e393082570db2d0a651ddb79a365bc4a0f8d Mon Sep 17 00:00:00 2001 From: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> Date: Fri, 10 Feb 2023 12:04:24 +0000 Subject: [PATCH] Move `.m.rule.roomnotif` before `.m.rule.tombstone` (#1421) See https://github.com/matrix-org/matrix-spec/issues/1406 for the reasoning on this. TL;DR: the spec has always been wrong here. --- .../newsfragments/1421.clarification | 1 + content/client-server-api/modules/push.md | 62 +++++++++---------- 2 files changed, 32 insertions(+), 31 deletions(-) create mode 100644 changelogs/client_server/newsfragments/1421.clarification diff --git a/changelogs/client_server/newsfragments/1421.clarification b/changelogs/client_server/newsfragments/1421.clarification new file mode 100644 index 00000000..07b86e2f --- /dev/null +++ b/changelogs/client_server/newsfragments/1421.clarification @@ -0,0 +1 @@ +Correct the order of the default override pushrules in the spec. diff --git a/content/client-server-api/modules/push.md b/content/client-server-api/modules/push.md index 74da879f..0a104bc1 100644 --- a/content/client-server-api/modules/push.md +++ b/content/client-server-api/modules/push.md @@ -524,29 +524,27 @@ Definition: } ``` -**`.m.rule.tombstone`** +**`.m.rule.roomnotif`** -Matches any state event whose type is `m.room.tombstone`. This is -intended to notify users of a room when it is upgraded, similar to what -an `@room` notification would accomplish. +Matches any message whose content is unencrypted and contains the text +`@room`, signifying the whole room should be notified of the event. Definition: ```json { - "rule_id": ".m.rule.tombstone", + "rule_id": ".m.rule.roomnotif", "default": true, "enabled": true, "conditions": [ { "kind": "event_match", - "key": "type", - "pattern": "m.room.tombstone" + "key": "content.body", + "pattern": "@room" }, { - "kind": "event_match", - "key": "state_key", - "pattern": "" + "kind": "sender_notification_permission", + "key": "room" } ], "actions": [ @@ -558,24 +556,24 @@ Definition: } ``` -**`.m.rule.room.server_acl`** - -{{% added-in v="1.4" %}} +**`.m.rule.tombstone`** -Suppresses notifications for [`m.room.server_acl`](#mroomserver_acl) events. +Matches any state event whose type is `m.room.tombstone`. This is +intended to notify users of a room when it is upgraded, similar to what +an `@room` notification would accomplish. Definition: ```json { - "rule_id": ".m.rule.room.server_acl", + "rule_id": ".m.rule.tombstone", "default": true, "enabled": true, "conditions": [ { "kind": "event_match", "key": "type", - "pattern": "m.room.server_acl" + "pattern": "m.room.tombstone" }, { "kind": "event_match", @@ -583,39 +581,41 @@ Definition: "pattern": "" } ], - "actions": [] + "actions": [ + "notify", + { + "set_tweak": "highlight" + } + ] } ``` -**`.m.rule.roomnotif`** +**`.m.rule.room.server_acl`** -Matches any message whose content is unencrypted and contains the text -`@room`, signifying the whole room should be notified of the event. +{{% added-in v="1.4" %}} + +Suppresses notifications for [`m.room.server_acl`](#mroomserver_acl) events. Definition: ```json { - "rule_id": ".m.rule.roomnotif", + "rule_id": ".m.rule.room.server_acl", "default": true, "enabled": true, "conditions": [ { "kind": "event_match", - "key": "content.body", - "pattern": "@room" + "key": "type", + "pattern": "m.room.server_acl" }, { - "kind": "sender_notification_permission", - "key": "room" + "kind": "event_match", + "key": "state_key", + "pattern": "" } ], - "actions": [ - "notify", - { - "set_tweak": "highlight" - } - ] + "actions": [] } ```