|
| 1 | +# MSC3957: Suppress notifications of message edits |
| 2 | + |
| 3 | +[Event replacement](https://spec.matrix.org/v1.5/client-server-api/#event-replacements) |
| 4 | +(more commonly known as message edits) signals that a message is intended to |
| 5 | +be replaced with new content. |
| 6 | + |
| 7 | +This works well for fixing typos or correcting information, but tends to cause |
| 8 | +spurious notifications if the event mentions a user. This contributes to notification |
| 9 | +fatigue as the additional notifications contain no new information. |
| 10 | + |
| 11 | + |
| 12 | +## Proposal |
| 13 | + |
| 14 | +A new default push rule is added to suppress notifications [due to edits](https://spec.matrix.org/v1.5/client-server-api/#event-replacements). |
| 15 | + |
| 16 | +```json |
| 17 | +{ |
| 18 | + "rule_id": ".m.rule.suppress_edits", |
| 19 | + "default": true, |
| 20 | + "enabled": true, |
| 21 | + "conditions": [ |
| 22 | + { |
| 23 | + "kind": "event_match", |
| 24 | + "key": "content.m.relates_to.rel_type", |
| 25 | + "pattern": "m.replace" |
| 26 | + } |
| 27 | + ], |
| 28 | + "actions": [] |
| 29 | +} |
| 30 | +``` |
| 31 | + |
| 32 | +This rule should be placed as the [first override rule](https://spec.matrix.org/v1.5/client-server-api/#default-override-rules). |
| 33 | + |
| 34 | +It would match events such as those given in [event replacements](https://spec.matrix.org/v1.5/client-server-api/#event-replacements) |
| 35 | +portion of the spec: |
| 36 | + |
| 37 | +```json5 |
| 38 | +{ |
| 39 | + "type": "m.room.message", |
| 40 | + "content": { |
| 41 | + "body": "* Hello! My name is bar", |
| 42 | + "msgtype": "m.text", |
| 43 | + "m.new_content": { |
| 44 | + "body": "Hello! My name is bar", |
| 45 | + "msgtype": "m.text" |
| 46 | + }, |
| 47 | + "m.relates_to": { |
| 48 | + "rel_type": "m.replace", |
| 49 | + "event_id": "$some_event_id" |
| 50 | + } |
| 51 | + }, |
| 52 | + // ... other fields required by events |
| 53 | +} |
| 54 | +``` |
| 55 | + |
| 56 | +## Potential issues |
| 57 | + |
| 58 | +Some users may be depending on notifications of edits. If a user would like to |
| 59 | +revert to the old behavior they can disable the `.m.rule.suppress_edits` push rule. |
| 60 | + |
| 61 | +If the message edits were alloewd by other senders than it would be useful to |
| 62 | +know that your own message was edited, but this |
| 63 | +[is not currently allowed](https://spec.matrix.org/v1.5/client-server-api/#validity-of-replacement-events). |
| 64 | + |
| 65 | +## Alternatives |
| 66 | + |
| 67 | +None explored. |
| 68 | + |
| 69 | +## Security considerations |
| 70 | + |
| 71 | +None forseen. |
| 72 | + |
| 73 | +## Unstable prefix |
| 74 | + |
| 75 | +The unstable prefix of `.com.beeper.suppress_edits` should be used in place of |
| 76 | +`.m.rule.suppress_edits`. |
| 77 | + |
| 78 | +## Dependencies |
| 79 | + |
| 80 | +N/A |
0 commit comments