From e1dc5f8f53a4ec1eee2a26ed03bbd9e0ca0067d1 Mon Sep 17 00:00:00 2001 From: Patrick Cloke Date: Wed, 3 May 2023 09:39:49 -0400 Subject: [PATCH] Remove the `dont_notify` and `coalesce` push rule actions. (#1501) * Remove the `dont_notify` and `coalesce` push rule actions. Per MSC3987, these should both be considered no-ops. * Remove obsolete dont_notify from default rules. * Remove obsolete dont_notify from examples. --- .../newsfragments/1501.clarification | 1 + content/client-server-api/modules/push.md | 33 +++++++------------ data/api/client-server/pushrules.yaml | 12 ++----- data/event-schemas/examples/m.push_rules.yaml | 8 ++--- 4 files changed, 17 insertions(+), 37 deletions(-) create mode 100644 changelogs/client_server/newsfragments/1501.clarification diff --git a/changelogs/client_server/newsfragments/1501.clarification b/changelogs/client_server/newsfragments/1501.clarification new file mode 100644 index 00000000..97fa837c --- /dev/null +++ b/changelogs/client_server/newsfragments/1501.clarification @@ -0,0 +1 @@ +Remove the `dont_notify` and `coalesce` push rule actions per [MSC3987](https://github.com/matrix-org/matrix-spec-proposals/pull/3987). diff --git a/content/client-server-api/modules/push.md b/content/client-server-api/modules/push.md index 66c498ea..9a2a671f 100644 --- a/content/client-server-api/modules/push.md +++ b/content/client-server-api/modules/push.md @@ -147,17 +147,6 @@ actions are defined: : This causes each matching event to generate a notification. -`dont_notify` - -: This prevents each matching event from generating a notification. - -`coalesce` - -: This enables notifications for matching events but activates homeserver - specific behaviour to intelligently coalesce multiple events into a - single notification. Not all homeservers may support this. Those that do - not support it should treat it as the `notify` action. - `set_tweak` : Sets an entry in the `tweaks` dictionary key that is sent in the @@ -195,6 +184,12 @@ they are represented as a dictionary with a key equal to their name and other keys as their parameters, e.g. `{ "set_tweak": "sound", "value": "default" }`. +{{% boxes/note %}} +Older versions of the Matrix specification included the `dont_notify` and +`coalesce` actions. These should both be considered no-ops (ignored, not +rejected) if received from a client. +{{% /boxes/note %}} + ##### Conditions `override` and `underride` rules MAY have a list of 'conditions'. All @@ -440,9 +435,7 @@ Definition: "default": true, "enabled": false, "conditions": [], - "actions": [ - "dont_notify" - ] + "actions": [] } ``` @@ -464,9 +457,7 @@ Definition: "pattern": "m.notice", } ], - "actions": [ - "dont_notify", - ] + "actions": [] } ``` @@ -526,9 +517,7 @@ Definition: "pattern": "m.room.member" } ], - "actions": [ - "dont_notify" - ] + "actions": [] } ``` @@ -882,14 +871,14 @@ To create a rule that suppresses notifications for the room with ID curl -X PUT -H "Content-Type: application/json" "https://example.com/_matrix/client/v3/pushrules/global/room/%21dj234r78wl45Gh4D%3Amatrix.org?access_token=123456" -d \ '{ - "actions" : ["dont_notify"] + "actions" : [] }' To suppress notifications for the user `@spambot:matrix.org`: curl -X PUT -H "Content-Type: application/json" "https://example.com/_matrix/client/v3/pushrules/global/sender/%40spambot%3Amatrix.org?access_token=123456" -d \ '{ - "actions" : ["dont_notify"] + "actions" : [] }' To always notify for messages that contain the work 'cake' and set a diff --git a/data/api/client-server/pushrules.yaml b/data/api/client-server/pushrules.yaml index 3a67aea8..817138d1 100644 --- a/data/api/client-server/pushrules.yaml +++ b/data/api/client-server/pushrules.yaml @@ -75,18 +75,14 @@ paths: ], "override": [ { - "actions": [ - "dont_notify" - ], + "actions": [], "conditions": [], "default": true, "enabled": false, "rule_id": ".m.rule.master" }, { - "actions": [ - "dont_notify" - ], + "actions": [], "conditions": [ { "key": "content.msgtype", @@ -286,9 +282,7 @@ paths: rule itself such as the rule's `actions` and `conditions` if set. examples: application/json: { - "actions": [ - "dont_notify" - ], + "actions": [], "pattern": "cake*lie", "rule_id": "nocake", "enabled": true, diff --git a/data/event-schemas/examples/m.push_rules.yaml b/data/event-schemas/examples/m.push_rules.yaml index 34bc2fe6..639c6ec7 100644 --- a/data/event-schemas/examples/m.push_rules.yaml +++ b/data/event-schemas/examples/m.push_rules.yaml @@ -23,18 +23,14 @@ ], "override": [ { - "actions": [ - "dont_notify" - ], + "actions": [], "conditions": [], "default": true, "enabled": false, "rule_id": ".m.rule.master" }, { - "actions": [ - "dont_notify" - ], + "actions": [], "conditions": [ { "key": "content.msgtype",