diff --git a/res/css/views/dialogs/_CreateRoomDialog.scss b/res/css/views/dialogs/_CreateRoomDialog.scss index c542741c30..ac46b8e91a 100644 --- a/res/css/views/dialogs/_CreateRoomDialog.scss +++ b/res/css/views/dialogs/_CreateRoomDialog.scss @@ -78,6 +78,7 @@ limitations under the License. .mx_SettingsFlag { display: flex; + margin-top: 4px; } .mx_SettingsFlag_label { diff --git a/src/components/views/dialogs/CreateRoomDialog.js b/src/components/views/dialogs/CreateRoomDialog.js index 77014db21d..2431a4d32f 100644 --- a/src/components/views/dialogs/CreateRoomDialog.js +++ b/src/components/views/dialogs/CreateRoomDialog.js @@ -24,6 +24,7 @@ import withValidation from '../elements/Validation'; import { _t } from '../../../languageHandler'; import {MatrixClientPeg} from '../../../MatrixClientPeg'; import {Key} from "../../../Keyboard"; +import SettingsStore from "../../../settings/SettingsStore"; export default createReactClass({ displayName: 'CreateRoomDialog', @@ -35,6 +36,7 @@ export default createReactClass({ const config = SdkConfig.get(); return { isPublic: false, + isEncrypted: true, name: "", topic: "", alias: "", @@ -62,6 +64,11 @@ export default createReactClass({ if (this.state.noFederate) { createOpts.creation_content = {'m.federate': false}; } + + if (!this.state.isPublic && SettingsStore.isFeatureEnabled("feature_cross_signing")) { + createOpts.encryption = this.state.isEncrypted; + } + return opts; }, @@ -127,6 +134,10 @@ export default createReactClass({ this.setState({isPublic}); }, + onEncryptedChange(isEncrypted) { + this.setState({isEncrypted}); + }, + onAliasChange(alias) { this.setState({alias}); }, @@ -181,6 +192,14 @@ export default createReactClass({ privateLabel = (
{_t("This room is private, and can only be joined by invitation.")}
); } + let e2eeSection; + if (!this.state.isPublic && SettingsStore.isFeatureEnabled("feature_cross_signing")) { + e2eeSection =