From b18f54c845d533c05483ecd8f9b07300ef39e58c Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Fri, 13 Sep 2019 12:05:55 +0100 Subject: [PATCH 1/3] don't push by default for group chats. see https://github.com/vector-im/riot-web/issues/3268 This only works for new servers (e.g. mozilla-test.modular.im) --- synapse/push/baserules.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/synapse/push/baserules.py b/synapse/push/baserules.py index 286374d0b537..4d57a89d7eb3 100644 --- a/synapse/push/baserules.py +++ b/synapse/push/baserules.py @@ -335,7 +335,13 @@ def make_base_prepend_rules(kind, modified_base_rules): "_id": "_message", } ], - "actions": ["notify", {"set_tweak": "highlight", "value": False}], + "actions": [ + # default to not notifying for group chats + # see https://github.com/vector-im/riot-web/issues/3268 + # we can't do this on existing servers because we need to + # add per-user overrides to preserve their existing behaviour + "dont_notify" + ], }, # XXX: this is going to fire for events which aren't m.room.messages # but are encrypted (e.g. m.call.*)... From 8a2e8eaaecb40ca0997b086ddc568aa3fee09152 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Fri, 13 Sep 2019 12:14:29 +0100 Subject: [PATCH 2/3] default off groupchat push correctly --- synapse/push/baserules.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/synapse/push/baserules.py b/synapse/push/baserules.py index 4d57a89d7eb3..47cf01e3dc3a 100644 --- a/synapse/push/baserules.py +++ b/synapse/push/baserules.py @@ -335,12 +335,14 @@ def make_base_prepend_rules(kind, modified_base_rules): "_id": "_message", } ], + # default to not notifying for group chats + # see https://github.com/vector-im/riot-web/issues/3268 + # we can't do this on existing servers because we need to + # add per-user overrides to preserve their existing behaviour + "enabled": False, "actions": [ - # default to not notifying for group chats - # see https://github.com/vector-im/riot-web/issues/3268 - # we can't do this on existing servers because we need to - # add per-user overrides to preserve their existing behaviour - "dont_notify" + "notify", + {"set_tweak": "highlight", "value": False} ], }, # XXX: this is going to fire for events which aren't m.room.messages From f69f4e7a971233eb1625ba91ca2e24dadb99e2a9 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Fri, 13 Sep 2019 14:14:51 +0100 Subject: [PATCH 3/3] Black --- synapse/push/baserules.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/synapse/push/baserules.py b/synapse/push/baserules.py index 47cf01e3dc3a..796fa297510b 100644 --- a/synapse/push/baserules.py +++ b/synapse/push/baserules.py @@ -340,10 +340,7 @@ def make_base_prepend_rules(kind, modified_base_rules): # we can't do this on existing servers because we need to # add per-user overrides to preserve their existing behaviour "enabled": False, - "actions": [ - "notify", - {"set_tweak": "highlight", "value": False} - ], + "actions": ["notify", {"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.*)...