summary refs log tree commit diff
path: root/synapse/handlers
diff options
context:
space:
mode:
authorKegan Dougal <kegan@matrix.org>2015-01-27 17:15:06 +0000
committerKegan Dougal <kegan@matrix.org>2015-01-27 17:15:06 +0000
commitec3719b583c6fbbc56dbd313b858054e535ae733 (patch)
tree69aaad6a1f6fe12edfd5129b44085fc95e128853 /synapse/handlers
parentAdd stub methods, TODOs and docstrings for application services. (diff)
downloadsynapse-ec3719b583c6fbbc56dbd313b858054e535ae733.tar.xz
Use ApplicationService when registering.
Diffstat (limited to 'synapse/handlers')
-rw-r--r--synapse/handlers/appservice.py13
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)