Page MenuHomePhorge

Differentiate between messages with and without sound
ClosedPublic

Authored by tusooa on May 7 2024, 2:00 PM.
Tags
None
Referenced Files
F114395: D21.1732544043.diff
Sun, Nov 24, 6:14 AM
F113701: D21.1732488687.diff
Sat, Nov 23, 2:51 PM
F113700: D21.1732488683.diff
Sat, Nov 23, 2:51 PM
F113647: D21.1732488347.diff
Sat, Nov 23, 2:45 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
Branch
tusooa/stacked
Lint
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 35
Build 61: GitLab CI for kazv
Build 60: arc lint + arc unit