Support inviting 3pids in /createRoom
This commit is contained in:
parent
07c33eff43
commit
1b5642604b
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue