diff options
author | Kegan Dougal <kegan@matrix.org> | 2015-01-27 17:15:06 +0000 |
---|---|---|
committer | Kegan Dougal <kegan@matrix.org> | 2015-01-27 17:15:06 +0000 |
commit | ec3719b583c6fbbc56dbd313b858054e535ae733 (patch) | |
tree | 69aaad6a1f6fe12edfd5129b44085fc95e128853 /synapse/handlers/appservice.py | |
parent | Add stub methods, TODOs and docstrings for application services. (diff) | |
download | synapse-ec3719b583c6fbbc56dbd313b858054e535ae733.tar.xz |
Use ApplicationService when registering.
Diffstat (limited to 'synapse/handlers/appservice.py')
-rw-r--r-- | synapse/handlers/appservice.py | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/synapse/handlers/appservice.py b/synapse/handlers/appservice.py index 25e1cece56..1890ca06aa 100644 --- a/synapse/handlers/appservice.py +++ b/synapse/handlers/appservice.py @@ -30,21 +30,18 @@ class ApplicationServicesHandler(BaseHandler): super(ApplicationServicesHandler, self).__init__(hs) @defer.inlineCallbacks - def register(self, base_url, token, namespaces): + def register(self, app_service): # check the token is recognised try: - app_service = yield self.store.get_app_service(token) - if not app_service: - raise StoreError + stored_service = yield self.store.get_app_service(app_service.token) + if not stored_service: + raise StoreError(404, "Not found") except StoreError: raise SynapseError( 403, "Unrecognised application services token. " "Consult the home server admin." ) - - # store this AS - - defer.returnValue("not_implemented_yet") + # TODO store this AS def unregister(self, token): yield self.store.unregister_app_service(token) |