createRoom, only send join rule event if we have a join rule to put inside it

pull/21833/head
Michael Telatynski 2021-07-30 15:10:08 +01:00
parent 27e432df4b
commit 868cb2132e
1 changed files with 2 additions and 1 deletions

View File

@ -184,7 +184,8 @@ export default async function createRoom(opts: IOpts): Promise<string | null> {
} }
} }
if (opts.joinRule !== JoinRule.Restricted) { // we handle the restricted join rule in the parentSpace handling block above
if (opts.joinRule && opts.joinRule !== JoinRule.Restricted) {
createOpts.initial_state.push({ createOpts.initial_state.push({
type: EventType.RoomJoinRules, type: EventType.RoomJoinRules,
content: { join_rule: opts.joinRule }, content: { join_rule: opts.joinRule },