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/rest/appservice/v1/register.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/rest/appservice/v1/register.py')
-rw-r--r-- | synapse/rest/appservice/v1/register.py | 8 |
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") |