Add get endpoint for pushers

As per https://github.com/matrix-org/matrix-doc/pull/308
This commit is contained in:
David Baker 2016-04-11 18:00:03 +01:00
parent 790f5848b2
commit 8a76094965
2 changed files with 53 additions and 1 deletions

View file

@ -75,6 +75,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):