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

Possible solution for polls notifications #1065

Closed
turt2live opened this issue May 16, 2022 · 1 comment
Closed

Possible solution for polls notifications #1065

turt2live opened this issue May 16, 2022 · 1 comment
Labels
improvement An idea/future MSC for the spec

Comments

@turt2live
Copy link
Member

Original MSC3381 was set to include push rules, however in the end it's just not practical for this stage of development. Below is the original proposal text, unmodified.

Notifications

In order to have polls behave similar to message events, the following underride push rules are defined.
Note that the push rules are mirrored from those available to m.room.message events.

{
  "rule_id": ".m.rule.poll_start_one_to_one",
  "default": true,
  "enabled": true,
  "conditions": [
    {"kind": "room_member_count", "is": "2"},
    {"kind": "event_match", "key": "type", "pattern": "m.poll.start"}
  ],
  "actions": [
    "notify",
    {"set_tweak": "sound", "value": "default"}
  ]
}
{
  "rule_id": ".m.rule.poll_start",
  "default": true,
  "enabled": true,
  "conditions": [
    {"kind": "event_match", "key": "type", "pattern": "m.poll.start"}
  ],
  "actions": [
    "notify"
  ]
}
{
  "rule_id": ".m.rule.poll_end_one_to_one",
  "default": true,
  "enabled": true,
  "conditions": [
    {"kind": "room_member_count", "is": "2"},
    {"kind": "event_match", "key": "type", "pattern": "m.poll.end"}
  ],
  "actions": [
    "notify",
    {"set_tweak": "sound", "value": "default"}
  ]
}

turt2live marked this conversation as resolved.

{
  "rule_id": ".m.rule.poll_end",
  "default": true,
  "enabled": true,
  "conditions": [
    {"kind": "event_match", "key": "type", "pattern": "m.poll.end"}
  ],
  "actions": [
    "notify"
  ]
}

Servers should keep these rules in sync with the m.room.message rules they are based upon. For
example, if the m.room.message rule gets muted in a room then the associated rules for polls would
also get muted. Similarly, if either of the two poll rules were to be muted in a room then the other
poll rule and the m.room.message rule would be muted as well.

Clients are expected to not require any specific change in order to support these rules. Their user
experience typically already considers an entry for "messages in the room", which is what a typical
user would expect to control notifications caused by polls.

The server-side syncing of the rules additionally means that clients won't have to manually add support
for the new rules. Servers as part of implementation will update and incorporate the rules on behalf
of the users and simply send them down /sync per normal - clients which parse the push rules manually
shouldn't have to do anything as the rule will execute normally.

@turt2live
Copy link
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement An idea/future MSC for the spec
Projects
None yet
Development

No branches or pull requests

1 participant