Skip to content

Commit bd9e842

Browse files
committed
Explain the postcontent push rule kind
1 parent f0a32bf commit bd9e842

File tree

1 file changed

+28
-1
lines changed

1 file changed

+28
-1
lines changed

proposals/4306-thread-subscriptions.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ As motivation, we want threads to have the following notification semantics:
176176
- Exceptions: if the user is mentioned, this should generate a notification as usual. (The push notification thus generated is also useful for the client to realise it needs to create an automatic thread subscription.)
177177
- Messages in subscribed threads should always count as a notification, and the (effective) room notification settings should not matter at all. E.g. the room can be muted, but if I, as a user, am subscribed to a thread, I still want to get a notification for new messages in that thread. If I do not want that, then I will unsubscribe.
178178

179-
To achieve this, we propose the addition of two new push rules, both added to a new push rule `kind` called `postcontent`, which is ordered between `content` and `room` but can contain general-purpose rules:
179+
To achieve this, we propose the addition of two new push rules, both added to a new push rule `kind` called `postcontent`, which is ordered between `content` and `room` but which can contain general-purpose rules:
180180

181181
1. `.m.rule.unsubscribed_thread`, at the beginning of the underride list. This rule causes events in unsubscribed threads to skip notification processing without generating a notification.
182182
The rule occurs after mention-specific rules and keyword mention rules, meaning that mentions continue to generate notifications.
@@ -221,6 +221,33 @@ The `thread_subscription` push condition is satisfied if and only if all the fol
221221
1. the event, which we are running push rules for, is part of a thread.
222222
2. the user is subscribed to the thread (`subscribed` = `true`) or is not subscribed to the thread (`subscribed` = `false`).
223223

224+
### Explanation of the rationale behind the `postcontent` push rule kind
225+
226+
We need a new push rule kind ordered between `content` and `room` because:
227+
228+
**For `.m.rule.unsubscribed_thread`**
229+
- this rule must come after any keyword mentions the user has configured (which would be configured in `content`)
230+
as those should still trigger mentions (and thus automatic thread subscriptions).
231+
- the rule must come before any room settings the user has configured, such as notifying on all messages in a room,
232+
as that would cause automatic subscriptions to every thread in the room and it would cause inconsistencies
233+
between the default 'notified for all messages' behaviour and 'notified for all messages in this room'.
234+
235+
**For `.m.rule.subscribed_thread`**
236+
- it seems inappropriate for an `override` rule to produce notifications, given the `override` rules generally
237+
are intended to suppress them.
238+
- more concretely, we should allow rules in the `override` and `content` block the opportunity to produce
239+
notifications with specific tweaks, e.g. `content` rules to match mentions might highlight the messages
240+
rather than simply notifying.
241+
- `.m.rule.contains_user_name` and user-specified keyword mention rules must therefore execute first
242+
so they can make use of `"set_tweak": "highlight"`.
243+
- this rule should come after `content` in case any users perform negative filtering (i.e. suppressing
244+
notifications for messages containing certain keywords), although the author is not aware of clients with
245+
such functionality.
246+
- this rule must come before `room` to avoid thread subscriptions being defeated by user rules such as
247+
the ones underlying 'Mentions only' or 'Mentions & Keywords' settings available in common clients.
248+
249+
For the time being, servers MUST ensure that clients MUST NOT be able to create custom rules with this push rule kind.
250+
224251
## Limitations and Potential Future Expansions
225252

226253
- Users will not have enough granularity to subscribe to threads in a way that lets them keep track of threads (being able to 'catch up' through some mechanism in their client) without also getting notifications for them, except by disabling ALL thread subscription notifications altogether.

0 commit comments

Comments
 (0)