diff options
author | Erik Johnston <erik@matrix.org> | 2016-01-05 11:56:21 +0000 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2016-01-05 11:56:21 +0000 |
commit | 1b5642604b9e5c662506d0bd2608d867287b6dfb (patch) | |
tree | 0bf1e675cd4212b508fdb274c2c357a5eb3650a1 /synapse | |
parent | Merge branch 'master' of github.com:matrix-org/synapse into develop (diff) | |
download | synapse-1b5642604b9e5c662506d0bd2608d867287b6dfb.tar.xz |
Support inviting 3pids in /createRoom
Diffstat (limited to '')
-rw-r--r-- | synapse/handlers/room.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/synapse/handlers/room.py b/synapse/handlers/room.py index 13f66e0df0..2bdc768199 100644 --- a/synapse/handlers/room.py +++ b/synapse/handlers/room.py @@ -115,6 +115,8 @@ class RoomCreationHandler(BaseHandler): except: raise SynapseError(400, "Invalid user_id: %s" % (i,)) + invite_3pid_list = config.get("invite_3pid", []) + is_public = config.get("visibility", None) == "public" if room_id: @@ -220,6 +222,20 @@ class RoomCreationHandler(BaseHandler): "content": {"membership": Membership.INVITE}, }, ratelimit=False) + for invite_3pid in invite_3pid_list: + id_server = invite_3pid["id_server"] + address = invite_3pid["address"] + medium = invite_3pid["medium"] + yield self.hs.get_handlers().room_member_handler.do_3pid_invite( + room_id, + user, + medium, + address, + id_server, + None, + None, + ) + result = {"room_id": room_id} if room_alias: |