summary refs log tree commit diff
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2016-01-26 17:30:00 +0000
committerErik Johnston <erik@matrix.org>2016-01-26 17:30:00 +0000
commite4e33c743ef1981734c5876206913ad1f839d72f (patch)
tree5f38327142abb0091adf86364b83407a98a71067
parentRemove redundated BaseHomeServer (diff)
parentMerge pull request #529 from matrix-org/dbkr/one_to_one_only_messages (diff)
downloadsynapse-e4e33c743ef1981734c5876206913ad1f839d72f.tar.xz
Merge branch 'develop' of github.com:matrix-org/synapse into erikj/server_refactor
-rw-r--r--synapse/push/baserules.py6
-rw-r--r--synapse/rest/client/v1/push_rule.py4
2 files changed, 8 insertions, 2 deletions
diff --git a/synapse/push/baserules.py b/synapse/push/baserules.py
index 186281dfa3..0832c77cb4 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': [
diff --git a/synapse/rest/client/v1/push_rule.py b/synapse/rest/client/v1/push_rule.py
index 2272d66dc7..cb3ec23872 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: