summary refs log tree commit diff
path: root/synapse/storage/pusher.py
diff options
context:
space:
mode:
authorDavid Baker <dave@matrix.org>2016-04-11 18:00:03 +0100
committerDavid Baker <dave@matrix.org>2016-04-11 18:00:03 +0100
commit8a76094965635eb2afd501038ea3c09f88416ce2 (patch)
tree3db97ac123d3251fe98b63be29c37509a5f8b04d /synapse/storage/pusher.py
parentFix the rule_id for .m.rule.invite_for_me (#715) (diff)
downloadsynapse-8a76094965635eb2afd501038ea3c09f88416ce2.tar.xz
Add get endpoint for pushers
As per https://github.com/matrix-org/matrix-doc/pull/308
Diffstat (limited to 'synapse/storage/pusher.py')
-rw-r--r--synapse/storage/pusher.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/synapse/storage/pusher.py b/synapse/storage/pusher.py
index 19888a8e76..11feab72de 100644
--- a/synapse/storage/pusher.py
+++ b/synapse/storage/pusher.py
@@ -76,6 +76,25 @@ class PusherStore(SQLBaseStore):
         defer.returnValue(rows)
 
     @defer.inlineCallbacks
+    def get_pushers_by_app_user_id(self, user_id):
+        def r(txn):
+            sql = (
+                "SELECT * FROM pushers"
+                " WHERE user_name = ?"
+            )
+
+            txn.execute(sql, (user_id,))
+            rows = self.cursor_to_dict(txn)
+
+            return self._decode_pushers_rows(rows)
+
+        result = yield self.runInteraction(
+            "get_pushers_by_user_id", r
+        )
+
+        defer.returnValue(result)
+
+    @defer.inlineCallbacks
     def get_all_pushers(self):
         def get_pushers(txn):
             txn.execute("SELECT * FROM pushers")