Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keywords to disable notifications #1074

Open
raphj opened this issue May 20, 2022 · 5 comments
Open

Keywords to disable notifications #1074

raphj opened this issue May 20, 2022 · 5 comments
Labels
A-Push feature Suggestion for a significant extension which needs considerable consideration

Comments

@raphj
Copy link

raphj commented May 20, 2022

(I've first reported this for Element at element-hq/element-meta#689 and submitting this here as suggested by @t3chguy - I'm not actually familiar enough with how the Matrix protocol works to go into technical details)

I'd like to be able to define keywords or regular expressions that will disable the message notification (possibly for some channel specifically). And maybe a maximum message length (if the message is longer, produce the notification). It would be like the notification keywords that already exist, but opposite.

Why would you like to do it?

I have notification enabled for each message. This is usually fine because the channels I'm in are quite low traffic and I want to be able to passively follow discussions while doing something else. However, there are messages that don't warrant any notifications. There's no way I'd meaningfully react to such messages and those can wait the next time I open Element.

For instance, it is the birthday of somebody and people are used to say "Happy birthday X!" in a specific channel. This is nice and warm, it also does not require being notified. The birthday lasts for the day, the messages can wait a few minutes or hours to be read.

How would you like to achieve it?

I'd like to define a list of keywords or sub-strings like "Happy birthday" that will disable the notification for messages containing it, possibly restricted to a channel. It's not perfect, because I could miss critical information in message like this: "Happy birthday X! By the way, [CRITICAL INFORMATION]" so a regular expression or defining a maximum message length could be useful but then again, the critical information will be seen later and maybe it should belong to a separate message.

Have you considered any alternatives?

I considered temporarily disabling notifications for the channel in which these messages are sent but I still want to be notified for the other messages in this channel.

@t3chguy
Copy link
Member

t3chguy commented May 20, 2022

Related #594

@turt2live turt2live added A-Push feature Suggestion for a significant extension which needs considerable consideration labels May 28, 2022
@Mikaela
Copy link

Mikaela commented Oct 6, 2022

Loosely related case-sensitive keywords #205

@Mikaela

This comment was marked as off-topic.

@turt2live
Copy link
Member

@room is already controlled by its own push rule - it is not a keyword.

@zecakeh
Copy link
Contributor

zecakeh commented Jan 9, 2023

At the spec level it seems doable, by creating a push rule with a dont_notify action.

This first example allows to disable notification for messages containing happy birthday (case insensitive) with the given words in every room. It's a content rule:

{
  "actions": [
    "dont_notify"
  ],
  "pattern": "happy birthday"
}

This one has the possibly unexpected side effect of disabling also notifications for messages containing happy birthday and your Matrix username.

It's also doable per-room with an underride rule:

{
  "actions": [
    "dont_notify"
  ],
  "conditions": [
    {
      "key": "room_id",
      "kind": "event_match",
      "pattern": "!room_id:server.org"
    },
    {
      "kind": "event_match",
      "key": "content.body",
      "pattern": "happy birthday"
    }               
  ]
}

This one has no unwanted side-effects for default push rules.

Note that while regular expressions are not supported, it's possible to use a glob pattern. Conditions on message length are not supported either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Push feature Suggestion for a significant extension which needs considerable consideration
Projects
None yet
Development

No branches or pull requests

5 participants