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",
},
},
{
type: "m.room.history_visibility",
state_key: "",
content: {
history_visibility: "joined"
}
}
],
};
} else {
@ -403,6 +410,13 @@ export default {
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
//
const createRoomOptions = {
visibility: "private", // Not listed!
preset: "private_chat",
initial_state: [
{
type: "m.room.encryption",
state_key: "",
content: {
algorithm: "m.megolm.v1.aes-sha2",
},
},
{
type: "m.room.guest_access",
state_key: "",
content: {
guest_access: "forbidden",
},
},
],
invite: [userId]
visibility: "private", // Not listed!
preset: "private_chat",
initial_state: [
{
type: "m.room.encryption",
state_key: "",
content: {
algorithm: "m.megolm.v1.aes-sha2",
},
},
{
type: "m.room.guest_access",
state_key: "",
content: {
guest_access: "forbidden",
},
},
{
type: "m.room.history_visibility",
state_key: "",
content: {
history_visibility: "joined",
},
},
],
invite: [userId],
};
return this.matrixClient
.createRoom(createRoomOptions)