summary refs log tree commit diff
path: root/synapse/rest
diff options
context:
space:
mode:
Diffstat (limited to 'synapse/rest')
-rw-r--r--synapse/rest/appservice/v1/register.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/synapse/rest/appservice/v1/register.py b/synapse/rest/appservice/v1/register.py
index 142f09a638..5786cf873e 100644
--- a/synapse/rest/appservice/v1/register.py
+++ b/synapse/rest/appservice/v1/register.py
@@ -18,6 +18,7 @@ from twisted.internet import defer
 
 from base import AppServiceRestServlet, as_path_pattern
 from synapse.api.errors import CodeMessageException, SynapseError
+from synapse.storage.appservice import ApplicationService
 
 import json
 import logging
@@ -58,7 +59,10 @@ class RegisterRestServlet(AppServiceRestServlet):
             self._parse_namespace(namespaces, params["namespaces"], "rooms")
             self._parse_namespace(namespaces, params["namespaces"], "aliases")
 
-        hs_token = yield self.handler.register(as_url, as_token, namespaces)
+        app_service = ApplicationService(as_token, as_url, namespaces)
+
+        yield self.handler.register(app_service)
+        hs_token = "_not_implemented_yet"  # TODO: Pull this from self.hs?
 
         defer.returnValue({
           "hs_token": hs_token
@@ -97,7 +101,7 @@ class UnregisterRestServlet(AppServiceRestServlet):
         except (KeyError, ValueError):
             raise SynapseError(400, "Missing required key: as_token(str)")
 
-        # TODO: pass to the appservice handler
+        yield self.handler.unregister(as_token)
 
         raise CodeMessageException(500, "Not implemented")