summary refs log tree commit diff
path: root/synapse/rest
diff options
context:
space:
mode:
authorDaniel Wagner-Hall <daniel@matrix.org>2016-02-15 16:16:03 +0000
committerDaniel Wagner-Hall <daniel@matrix.org>2016-02-15 16:16:03 +0000
commit150fcde0dce02670c2180f9d4657783eb204daa8 (patch)
tree6f3f6b12bc31ba3c69428e3e57d19ba6e2f4dc78 /synapse/rest
parentInline _do_local_membership_update (diff)
downloadsynapse-150fcde0dce02670c2180f9d4657783eb204daa8.tar.xz
Reuse update_membership from /join
Diffstat (limited to 'synapse/rest')
-rw-r--r--synapse/rest/client/v1/room.py21
1 files changed, 5 insertions, 16 deletions
diff --git a/synapse/rest/client/v1/room.py b/synapse/rest/client/v1/room.py
index 340c24635d..f8cd746a88 100644
--- a/synapse/rest/client/v1/room.py
+++ b/synapse/rest/client/v1/room.py
@@ -242,23 +242,12 @@ class JoinRoomAliasServlet(ClientV1RestServlet):
                 room_identifier,
             ))
 
-        msg_handler = self.handlers.message_handler
-        content = {"membership": Membership.JOIN}
-        if requester.is_guest:
-            content["kind"] = "guest"
-        yield msg_handler.create_and_send_event(
-            {
-                "type": EventTypes.Member,
-                "content": content,
-                "room_id": room_id,
-                "sender": requester.user.to_string(),
-                "state_key": requester.user.to_string(),
-
-                "membership": Membership.JOIN,  # For backwards compatibility
-            },
-            token_id=requester.access_token_id,
+        yield self.handlers.room_member_handler.update_membership(
+            requester=requester,
+            target=requester.user,
+            room_id=room_id,
+            action="join",
             txn_id=txn_id,
-            is_guest=requester.is_guest,
             room_hosts=room_hosts,
         )