Page MenuHomePhorge

Differentiate between messages with and without sound
ClosedPublic

Authored by tusooa on May 7 2024, 2:00 PM.
Tags
None
Referenced Files
F112426: D21.1732311204.diff
Thu, Nov 21, 1:33 PM
F112131: D21.1732272017.diff
Thu, Nov 21, 2:40 AM
F112130: D21.1732272013.diff
Thu, Nov 21, 2:40 AM
F112129: D21.1732272010.diff
Thu, Nov 21, 2:40 AM
F112101: D21.1732271274.diff
Thu, Nov 21, 2:27 AM
Subscribers
None

Details

Summary

The push rules part of the Matrix spec can differentiate between notifications with and without sound. This commit allows kazv to also make that distinction. Push rules that have an action of { "set_tweak": "sound" } will create a KNotification of event id message and those without that action will create one of event id messageWithoutSound.

Type: add

Test Plan

Edit the .m.rule.is_user_mention rule of your m.push_rules account data event to be the following:

{
  "conditions": [
    {
      "kind": "event_property_contains",
      "key": "content.m\\.mentions.user_ids",
      "value": "@tusooa:tusooa.xyz"
    }
  ],
  "actions": [
    "notify",
    {
      "set_tweak": "highlight"
    }
  ],
  "rule_id": ".m.rule.is_user_mention",
  "default": true,
  "enabled": true
}

In a group chat, mention your matrix id from another user.

Verify that a notification dialog is shown, and there is no notification sound.

Diff Detail

Repository
rK kazv
Lint
Lint Not Applicable
Unit
Tests Not Applicable