summary refs log tree commit diff
path: root/synapse/handlers/room_member.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2018-03-13 12:04:38 +0000
committerErik Johnston <erik@matrix.org>2018-03-13 12:08:58 +0000
commit8b3573a8b209c60b03d5ef7f4dfed9ccb9e9f7b3 (patch)
tree13c6ef6efc9b2218a123fadc79ccec968789ca3b /synapse/handlers/room_member.py
parentMerge pull request #2962 from matrix-org/rav/purge_history_txns (diff)
downloadsynapse-8b3573a8b209c60b03d5ef7f4dfed9ccb9e9f7b3.tar.xz
Refactor get_or_register_3pid_guest
Diffstat (limited to '')
-rw-r--r--synapse/handlers/room_member.py10
1 files changed, 3 insertions, 7 deletions
diff --git a/synapse/handlers/room_member.py b/synapse/handlers/room_member.py
index ed3b97730d..c3c720536e 100644
--- a/synapse/handlers/room_member.py
+++ b/synapse/handlers/room_member.py
@@ -735,20 +735,16 @@ class RoomMemberHandler(object):
         }
 
         if self.config.invite_3pid_guest:
-            registration_handler = self.registration_handler
-            guest_access_token = yield registration_handler.guest_access_token_for(
+            rh = self.registration_handler
+            guest_user_id, guest_access_token = yield rh.get_or_register_3pid_guest(
                 medium=medium,
                 address=address,
                 inviter_user_id=inviter_user_id,
             )
 
-            guest_user_info = yield self.auth.get_user_by_access_token(
-                guest_access_token
-            )
-
             invite_config.update({
                 "guest_access_token": guest_access_token,
-                "guest_user_id": guest_user_info["user"].to_string(),
+                "guest_user_id": guest_user_id,
             })
 
         data = yield self.simple_http_client.post_urlencoded_get_json(