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();
|
if (caps['m.room_versions'].available?.['9'] !== 'stable') {
|
||||||
options.room_version = caps
|
throw new Error("ERROR: The server doesn't support restricted rooms");
|
||||||
?.['m.room_versions']
|
}
|
||||||
?.['org.matrix.msc3244.room_capabilities']
|
if (Number(caps['m.room_versions'].default) < 9) {
|
||||||
?.restricted
|
options.room_version = '9';
|
||||||
?.preferred
|
|
||||||
|| 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