Remove MSC3244 use from restricted room creation (#892)
* Remove MSC3244 use from restricted room creation * Fix condition
This commit is contained in:
parent
bef759e358
commit
6a907b1542
1 changed files with 6 additions and 10 deletions
|
@ -236,16 +236,12 @@ async function createRoom(opts) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (parentId && joinRule === 'restricted') {
|
if (parentId && joinRule === 'restricted') {
|
||||||
try {
|
|
||||||
const caps = await mx.getCapabilities();
|
const caps = await mx.getCapabilities();
|
||||||
options.room_version = caps
|
if (caps['m.room_versions'].available?.['9'] !== 'stable') {
|
||||||
?.['m.room_versions']
|
throw new Error("ERROR: The server doesn't support restricted rooms");
|
||||||
?.['org.matrix.msc3244.room_capabilities']
|
}
|
||||||
?.restricted
|
if (Number(caps['m.room_versions'].default) < 9) {
|
||||||
?.preferred
|
options.room_version = '9';
|
||||||
|| undefined;
|
|
||||||
} catch {
|
|
||||||
console.error('Can\'t find room version for restricted.');
|
|
||||||
}
|
}
|
||||||
options.initial_state.push({
|
options.initial_state.push({
|
||||||
type: 'm.room.join_rules',
|
type: 'm.room.join_rules',
|
||||||
|
|
Loading…
Reference in a new issue