diff --git a/src/components/structures/MatrixChat.tsx b/src/components/structures/MatrixChat.tsx index 3929711406..e553057acb 100644 --- a/src/components/structures/MatrixChat.tsx +++ b/src/components/structures/MatrixChat.tsx @@ -623,7 +623,7 @@ export default class MatrixChat extends React.PureComponent { break; } case 'view_create_room': - this.createRoom(); + this.createRoom(payload.public); break; case 'view_create_group': { const CreateGroupDialog = sdk.getComponent("dialogs.CreateGroupDialog"); @@ -1012,9 +1012,9 @@ export default class MatrixChat extends React.PureComponent { }).close; } - private async createRoom() { + private async createRoom(defaultPublic = false) { const CreateRoomDialog = sdk.getComponent('dialogs.CreateRoomDialog'); - const modal = Modal.createTrackedDialog('Create Room', '', CreateRoomDialog); + const modal = Modal.createTrackedDialog('Create Room', '', CreateRoomDialog, { defaultPublic }); const [shouldCreate, opts] = await modal.finished; if (shouldCreate) { diff --git a/src/components/structures/RoomDirectory.js b/src/components/structures/RoomDirectory.js index 0b07c10c8a..86353cd532 100644 --- a/src/components/structures/RoomDirectory.js +++ b/src/components/structures/RoomDirectory.js @@ -367,7 +367,10 @@ export default createReactClass({ onCreateRoomClick: function(room) { this.props.onFinished(); - dis.dispatch({action: 'view_create_room'}); + dis.dispatch({ + action: 'view_create_room', + public: true, + }); }, showRoomAlias: function(alias, autoJoin=false) { diff --git a/src/components/views/dialogs/CreateRoomDialog.js b/src/components/views/dialogs/CreateRoomDialog.js index 74e006354b..fb08afa5f7 100644 --- a/src/components/views/dialogs/CreateRoomDialog.js +++ b/src/components/views/dialogs/CreateRoomDialog.js @@ -30,12 +30,13 @@ export default createReactClass({ displayName: 'CreateRoomDialog', propTypes: { onFinished: PropTypes.func.isRequired, + defaultPublic: PropTypes.bool, }, getInitialState() { const config = SdkConfig.get(); return { - isPublic: false, + isPublic: this.props.defaultPublic || false, isEncrypted: true, name: "", topic: "",