Merge branch 'thirdroom/dev' into add-room-type-in-summary
This commit is contained in:
commit
959c03f12f
3 changed files with 8 additions and 5 deletions
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "@thirdroom/hydrogen-view-sdk",
|
||||
"description": "Embeddable matrix client library, including view components",
|
||||
"version": "0.0.6",
|
||||
"version": "0.0.8",
|
||||
"main": "./hydrogen.es.js",
|
||||
"type": "module"
|
||||
}
|
||||
|
|
|
@ -80,7 +80,7 @@ export {TemplateView} from "./platform/web/ui/general/TemplateView";
|
|||
export {ViewModel} from "./domain/ViewModel";
|
||||
export {LoadingView} from "./platform/web/ui/general/LoadingView.js";
|
||||
export {AvatarView} from "./platform/web/ui/AvatarView.js";
|
||||
export {RoomVisibility} from "./matrix/room/common";
|
||||
export {RoomVisibility, RoomType} from "./matrix/room/common";
|
||||
export {EventEmitter} from "./utils/EventEmitter";
|
||||
export {Disposables} from "./utils/Disposables";
|
||||
export {LocalMedia} from "./matrix/calls/LocalMedia";
|
||||
|
|
|
@ -36,7 +36,7 @@ type CreateRoomPayload = {
|
|||
topic?: string;
|
||||
invite?: string[];
|
||||
room_alias_name?: string;
|
||||
creation_content?: {"m.federate": boolean, type?: string};
|
||||
creation_content?: {"m.federate"?: boolean, type?: string};
|
||||
initial_state: {type: string; state_key: string; content: Record<string, any>}[]
|
||||
power_level_content_override?: any;
|
||||
}
|
||||
|
@ -150,12 +150,15 @@ export class RoomBeingCreated extends EventEmitter<{change: never}> {
|
|||
if (this.options.alias) {
|
||||
createOptions.room_alias_name = this.options.alias;
|
||||
}
|
||||
if (this.options.isFederationDisabled === true) {
|
||||
if (this.options.type !== undefined) {
|
||||
createOptions.creation_content = {
|
||||
type: this.options.type === RoomType.World ? "org.matrix.msc3815.world" : undefined,
|
||||
"m.federate": false
|
||||
};
|
||||
}
|
||||
if (this.options.isFederationDisabled === true) {
|
||||
if (createOptions.creation_content === undefined) createOptions.creation_content = {};
|
||||
createOptions.creation_content["m.federate"] = false;
|
||||
}
|
||||
if (this.isEncrypted) {
|
||||
createOptions.initial_state.push(createRoomEncryptionEvent());
|
||||
}
|
||||
|
|
Reference in a new issue