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.
This commit is contained in:
Richard van der Hoff 2019-07-08 19:01:08 +01:00 committed by GitHub
parent 43d175d17a
commit 824707383b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 44 additions and 81 deletions

View file

@ -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.