summary refs log tree commit diff
path: root/synapse/storage
diff options
context:
space:
mode:
authorDavid Baker <dave@matrix.org>2015-01-23 17:49:37 +0000
committerDavid Baker <dave@matrix.org>2015-01-23 17:49:37 +0000
commit5f84ba8ea1991dff279f0135f474d9debfd1419a (patch)
tree698b25a9c157be4b6f18ff6226a59f57c3bafa0c /synapse/storage
parentUse push settings! (diff)
downloadsynapse-5f84ba8ea1991dff279f0135f474d9debfd1419a.tar.xz
Add API to delete push rules.
Diffstat (limited to 'synapse/storage')
-rw-r--r--synapse/storage/push_rule.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/synapse/storage/push_rule.py b/synapse/storage/push_rule.py
index 2366090e09..ca04f2ccee 100644
--- a/synapse/storage/push_rule.py
+++ b/synapse/storage/push_rule.py
@@ -174,6 +174,15 @@ class PushRuleStore(SQLBaseStore):
 
         txn.execute(sql, new_rule.values())
 
+    @defer.inlineCallbacks
+    def delete_push_rule(self, user_name, rule_id):
+        yield self._simple_delete_one(
+            PushRuleTable.table_name,
+            {
+                'user_name': user_name,
+                'rule_id': rule_id
+            }
+        )
 
 class RuleNotFoundException(Exception):
     pass