Set room history visibility to "joined"

Issue #169
This commit is contained in:
N-Pex 2021-10-13 15:34:21 +02:00
parent 6f13783dcb
commit 75ade37892
2 changed files with 40 additions and 19 deletions

View file

@ -380,6 +380,13 @@ export default {
algorithm: "m.megolm.v1.aes-sha2", algorithm: "m.megolm.v1.aes-sha2",
}, },
}, },
{
type: "m.room.history_visibility",
state_key: "",
content: {
history_visibility: "joined"
}
}
], ],
}; };
} else { } else {
@ -403,6 +410,13 @@ export default {
guest_access: "forbidden", guest_access: "forbidden",
}, },
}, },
{
type: "m.room.history_visibility",
state_key: "",
content: {
history_visibility: "joined"
}
}
], ],
}; };
} }

View file

@ -626,25 +626,32 @@ export default {
// No room found, create one // No room found, create one
// //
const createRoomOptions = { const createRoomOptions = {
visibility: "private", // Not listed! visibility: "private", // Not listed!
preset: "private_chat", preset: "private_chat",
initial_state: [ initial_state: [
{ {
type: "m.room.encryption", type: "m.room.encryption",
state_key: "", state_key: "",
content: { content: {
algorithm: "m.megolm.v1.aes-sha2", algorithm: "m.megolm.v1.aes-sha2",
}, },
}, },
{ {
type: "m.room.guest_access", type: "m.room.guest_access",
state_key: "", state_key: "",
content: { content: {
guest_access: "forbidden", guest_access: "forbidden",
}, },
}, },
], {
invite: [userId] type: "m.room.history_visibility",
state_key: "",
content: {
history_visibility: "joined",
},
},
],
invite: [userId],
}; };
return this.matrixClient return this.matrixClient
.createRoom(createRoomOptions) .createRoom(createRoomOptions)