Skip to content
Snippets Groups Projects
Commit e0d2c688 authored by David Baker's avatar David Baker
Browse files

Allow kind to be set to null to delete a pusher.

parent acb68a39
No related branches found
No related tags found
No related merge requests found
...@@ -31,6 +31,16 @@ class PusherRestServlet(ClientV1RestServlet): ...@@ -31,6 +31,16 @@ class PusherRestServlet(ClientV1RestServlet):
content = _parse_json(request) content = _parse_json(request)
pusher_pool = self.hs.get_pusherpool()
if ('pushkey' in content and 'app_id' in content
and 'kind' in content and
content['kind'] is None):
yield pusher_pool.remove_pusher(
content['app_id'], content['pushkey']
)
defer.returnValue((200, {}))
reqd = ['instance_handle', 'kind', 'app_id', 'app_display_name', reqd = ['instance_handle', 'kind', 'app_id', 'app_display_name',
'device_display_name', 'pushkey', 'lang', 'data'] 'device_display_name', 'pushkey', 'lang', 'data']
missing = [] missing = []
...@@ -41,7 +51,6 @@ class PusherRestServlet(ClientV1RestServlet): ...@@ -41,7 +51,6 @@ class PusherRestServlet(ClientV1RestServlet):
raise SynapseError(400, "Missing parameters: "+','.join(missing), raise SynapseError(400, "Missing parameters: "+','.join(missing),
errcode=Codes.MISSING_PARAM) errcode=Codes.MISSING_PARAM)
pusher_pool = self.hs.get_pusherpool()
try: try:
yield pusher_pool.add_pusher( yield pusher_pool.add_pusher(
user_name=user.to_string(), user_name=user.to_string(),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment