From b8d7ca9946ca770bd960b2e2f1316210a7c51cc9 Mon Sep 17 00:00:00 2001 From: Mathieu Velten Date: Fri, 18 Sep 2020 12:35:41 +0200 Subject: [PATCH] Make all rooms noisy by default (#60) --- changelog.d/60.misc | 1 + synapse/push/baserules.py | 12 ++++++++++-- tests/push/test_http.py | 12 ++++++------ 3 files changed, 17 insertions(+), 8 deletions(-) create mode 100644 changelog.d/60.misc diff --git a/changelog.d/60.misc b/changelog.d/60.misc new file mode 100644 index 0000000000..d2625a4f65 --- /dev/null +++ b/changelog.d/60.misc @@ -0,0 +1 @@ +Make all rooms noisy by default. diff --git a/synapse/push/baserules.py b/synapse/push/baserules.py index 286374d0b5..204d2d83f6 100644 --- a/synapse/push/baserules.py +++ b/synapse/push/baserules.py @@ -335,7 +335,11 @@ BASE_APPEND_UNDERRIDE_RULES = [ "_id": "_message", } ], - "actions": ["notify", {"set_tweak": "highlight", "value": False}], + "actions": [ + "notify", + {"set_tweak": "sound", "value": "default"}, + {"set_tweak": "highlight", "value": False}, + ], }, # XXX: this is going to fire for events which aren't m.room.messages # but are encrypted (e.g. m.call.*)... @@ -349,7 +353,11 @@ BASE_APPEND_UNDERRIDE_RULES = [ "_id": "_encrypted", } ], - "actions": ["notify", {"set_tweak": "highlight", "value": False}], + "actions": [ + "notify", + {"set_tweak": "sound", "value": "default"}, + {"set_tweak": "highlight", "value": False}, + ], }, ] diff --git a/tests/push/test_http.py b/tests/push/test_http.py index b567868b02..2f56cacc7a 100644 --- a/tests/push/test_http.py +++ b/tests/push/test_http.py @@ -346,8 +346,8 @@ class HTTPPusherTests(HomeserverTestCase): self.assertEqual(len(self.push_attempts), 2) self.assertEqual(self.push_attempts[1][1], "example.com") - # check that this is low-priority - self.assertEqual(self.push_attempts[1][2]["notification"]["prio"], "low") + # check that this is high-priority + self.assertEqual(self.push_attempts[1][2]["notification"]["prio"], "high") def test_sends_high_priority_for_mention(self): """ @@ -418,8 +418,8 @@ class HTTPPusherTests(HomeserverTestCase): self.assertEqual(len(self.push_attempts), 2) self.assertEqual(self.push_attempts[1][1], "example.com") - # check that this is low-priority - self.assertEqual(self.push_attempts[1][2]["notification"]["prio"], "low") + # check that this is high-priority + self.assertEqual(self.push_attempts[1][2]["notification"]["prio"], "high") def test_sends_high_priority_for_atroom(self): """ @@ -497,5 +497,5 @@ class HTTPPusherTests(HomeserverTestCase): self.assertEqual(len(self.push_attempts), 2) self.assertEqual(self.push_attempts[1][1], "example.com") - # check that this is low-priority - self.assertEqual(self.push_attempts[1][2]["notification"]["prio"], "low") + # check that this is high-priority + self.assertEqual(self.push_attempts[1][2]["notification"]["prio"], "high")