summary refs log tree commit diff
path: root/synapse/handlers/register.py
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2015-12-01 20:53:04 +0000
committerMark Haines <mark.haines@matrix.org>2015-12-01 20:53:04 +0000
commita9526831a45403d3da8165f7832cefc61282723c (patch)
tree15c28007a499e2baf93dd7c101f48a4909b14aa3 /synapse/handlers/register.py
parentMerge pull request #392 from matrix-org/markjh/client_config (diff)
downloadsynapse-a9526831a45403d3da8165f7832cefc61282723c.tar.xz
Wrap calls to distributor.fire in appropriately named functions so that static analysis can work out want is calling what
Diffstat (limited to 'synapse/handlers/register.py')
-rw-r--r--synapse/handlers/register.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/synapse/handlers/register.py b/synapse/handlers/register.py
index 493a087031..5166bc7b62 100644
--- a/synapse/handlers/register.py
+++ b/synapse/handlers/register.py
@@ -31,6 +31,10 @@ import urllib
 logger = logging.getLogger(__name__)
 
 
+def registered_user(distributor, user):
+    return distributor.fire("registered_user", user)
+
+
 class RegistrationHandler(BaseHandler):
 
     def __init__(self, hs):
@@ -98,7 +102,7 @@ class RegistrationHandler(BaseHandler):
                 password_hash=password_hash
             )
 
-            yield self.distributor.fire("registered_user", user)
+            yield registered_user(self.distributor, user)
         else:
             # autogen a random user ID
             attempts = 0
@@ -117,7 +121,7 @@ class RegistrationHandler(BaseHandler):
                         token=token,
                         password_hash=password_hash)
 
-                    self.distributor.fire("registered_user", user)
+                    yield registered_user(self.distributor, user)
                 except SynapseError:
                     # if user id is taken, just generate another
                     user_id = None
@@ -167,7 +171,7 @@ class RegistrationHandler(BaseHandler):
             token=token,
             password_hash=""
         )
-        self.distributor.fire("registered_user", user)
+        registered_user(self.distributor, user)
         defer.returnValue((user_id, token))
 
     @defer.inlineCallbacks
@@ -215,7 +219,7 @@ class RegistrationHandler(BaseHandler):
                 token=token,
                 password_hash=None
             )
-            yield self.distributor.fire("registered_user", user)
+            yield registered_user(self.distributor, user)
         except Exception, e:
             yield self.store.add_access_token_to_user(user_id, token)
             # Ignore Registration errors