matrix-org / matrix-spec

The Matrix protocol specification
Apache License 2.0
181 stars 94 forks source link

Notifications: `room_one_to_one` push rule does not consider `m.direct` flag #850

Open giomfo opened 3 years ago

giomfo commented 3 years ago

I'm talking about the following four global push rules (Underride Rules):

For example these rules are visible in the parameters of the Element-web client:

image

For the end user point of view one-to-one refers to the DM (Direct Messages). The problem is the server ignores the actual m.direct event defined in the user account data. The server only considers the room members count during the notifications handling.

Problem:

How it should work for the end user point of view

When sending out notifications the direct message flag should be respected:

nadonomy commented 3 years ago

When sending out notifications the direct message flag should be respected:

  • When it is a "normal" room, use notification settings for group chats. No matter if 2, 3 or more people are in the room
  • when it is a "DM flagged" room, use notification settings for DM

Agree 100%!

richvdh commented 3 years ago

this is actually a spec problem, since it's the spec that lays out what the default push rules are, so I'm moving it over to matrix-doc.

turt2live commented 3 years ago

for onlookers: this is because of the push rule conditions quite literally only checking member count (in a complicated and annoying way). From the looks of it, the push rules predated m.direct, which is why that might not have been considered. Encryption was bolted on after the fact and ended up duplicating the rules.

jakewb-b commented 3 years ago

Agree with making this spec change - but we will need to ensure that the settings then reflect the fact that the setting is based on the m.direct flag and not on a user count, as otherwise the text of the settings will contradict reality.

E.g. something like:

@gaelledel FYI

abmantis commented 2 years ago

This has a big impact in bridged chats, because usually those have 3 users on the room (matrix user, bridge puppet and bridge bot). This "forces" the user to set the default notification for groups to "noisy" (in Element), and then change the notification preference individually for each group room to "silent".

I think that the new rule could be added after (lower priority) the current one-to-one rules, so that current clients would not break while still using those one-to-one rules.