Page MenuHomePhorge

Differentiate between messages with and without sound
ClosedPublic

Authored by tusooa on May 7 2024, 2:00 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Sep 6, 12:01 PM
Unknown Object (File)
Thu, Sep 5, 4:49 PM
Unknown Object (File)
Thu, Sep 5, 2:03 PM
Unknown Object (File)
Thu, Sep 5, 7:53 AM
Unknown Object (File)
Mon, Aug 26, 11:05 PM
Unknown Object (File)
Mon, Aug 26, 8:35 PM
Unknown Object (File)
Mon, Aug 26, 8:38 AM
Unknown Object (File)
Sat, Aug 24, 11:37 PM
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