From e18257f0e52cf587ab4d7bb8937dbcaefeb26e54 Mon Sep 17 00:00:00 2001 From: Mark Haines Date: Mon, 25 Jan 2016 16:51:56 +0000 Subject: [PATCH 1/2] Add missing yield in push_rules set enabled --- synapse/rest/client/v1/push_rule.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/synapse/rest/client/v1/push_rule.py b/synapse/rest/client/v1/push_rule.py index 2272d66dc..cb3ec2387 100644 --- a/synapse/rest/client/v1/push_rule.py +++ b/synapse/rest/client/v1/push_rule.py @@ -52,7 +52,7 @@ class PushRuleRestServlet(ClientV1RestServlet): content = _parse_json(request) if 'attr' in spec: - self.set_rule_attr(requester.user.to_string(), spec, content) + yield self.set_rule_attr(requester.user.to_string(), spec, content) defer.returnValue((200, {})) try: @@ -228,7 +228,7 @@ class PushRuleRestServlet(ClientV1RestServlet): # bools directly, so let's not break them. raise SynapseError(400, "Value for 'enabled' must be boolean") namespaced_rule_id = _namespaced_rule_id_from_spec(spec) - self.hs.get_datastore().set_push_rule_enabled( + return self.hs.get_datastore().set_push_rule_enabled( user_id, namespaced_rule_id, val ) else: From 766c24b2e6efbb5d250f5a36809caf3026140593 Mon Sep 17 00:00:00 2001 From: David Baker Date: Tue, 26 Jan 2016 10:21:41 +0000 Subject: [PATCH 2/2] Only notify for messages in one to one rooms, not every event Fixes the fact that candidate events and hangups generated notifications. --- synapse/push/baserules.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/synapse/push/baserules.py b/synapse/push/baserules.py index 186281dfa..0832c77cb 100644 --- a/synapse/push/baserules.py +++ b/synapse/push/baserules.py @@ -173,6 +173,12 @@ BASE_APPEND_UNDERRIDE_RULES = [ 'kind': 'room_member_count', 'is': '2', '_id': 'member_count', + }, + { + 'kind': 'event_match', + 'key': 'type', + 'pattern': 'm.room.message', + '_id': '_message', } ], 'actions': [