summary refs log tree commit diff
path: root/synapse/module_api
diff options
context:
space:
mode:
authorRichard van der Hoff <1389908+richvdh@users.noreply.github.com>2019-07-08 19:01:08 +0100
committerGitHub <noreply@github.com>2019-07-08 19:01:08 +0100
commit824707383bea618ea809a0f13cf72168b87184f9 (patch)
tree4480c95aab06f81c46bc4caf4c327dea36ed47d8 /synapse/module_api
parentUnblacklist some user_directory sytests (#5637) (diff)
downloadsynapse-824707383bea618ea809a0f13cf72168b87184f9.tar.xz
Remove access-token support from RegistrationHandler.register (#5641)
Nothing uses this now, so we can remove the dead code, and clean up the
API.

Since we're changing the shape of the return value anyway, we take the
opportunity to give the method a better name.
Diffstat (limited to 'synapse/module_api')
-rw-r--r--synapse/module_api/__init__.py10
1 files changed, 2 insertions, 8 deletions
diff --git a/synapse/module_api/__init__.py b/synapse/module_api/__init__.py
index a0be2c5ca3..7bb020cb45 100644
--- a/synapse/module_api/__init__.py
+++ b/synapse/module_api/__init__.py
@@ -103,7 +103,6 @@ class ModuleApi(object):
         _, access_token = yield self.register_device(user_id)
         defer.returnValue((user_id, access_token))
 
-    @defer.inlineCallbacks
     def register_user(self, localpart, displayname=None, emails=[]):
         """Registers a new user with given localpart and optional displayname, emails.
 
@@ -115,15 +114,10 @@ class ModuleApi(object):
         Returns:
             Deferred[str]: user_id
         """
-        user_id, _ = yield self.hs.get_registration_handler().register(
-            localpart=localpart,
-            default_display_name=displayname,
-            bind_emails=emails,
-            generate_token=False,
+        return self.hs.get_registration_handler().register_user(
+            localpart=localpart, default_display_name=displayname, bind_emails=emails
         )
 
-        defer.returnValue(user_id)
-
     def register_device(self, user_id, device_id=None, initial_display_name=None):
         """Register a device for a user and generate an access token.