diff --git a/src/components/views/settings/tabs/room/SecurityRoomSettingsTab.js b/src/components/views/settings/tabs/room/SecurityRoomSettingsTab.js
index 48115146f1..0a0c693158 100644
--- a/src/components/views/settings/tabs/room/SecurityRoomSettingsTab.js
+++ b/src/components/views/settings/tabs/room/SecurityRoomSettingsTab.js
@@ -24,6 +24,7 @@ import Modal from "../../../../../Modal";
import QuestionDialog from "../../../dialogs/QuestionDialog";
import StyledRadioGroup from '../../../elements/StyledRadioGroup';
import {SettingLevel} from "../../../../../settings/SettingLevel";
+import SettingsStore from "../../../../../settings/SettingsStore";
export default class SecurityRoomSettingsTab extends React.Component {
static propTypes = {
@@ -340,10 +341,13 @@ export default class SecurityRoomSettingsTab extends React.Component {
const canEnableEncryption = !isEncrypted && hasEncryptionPermission;
let encryptionSettings = null;
- if (isEncrypted) {
- encryptionSettings =
;
+ if (isEncrypted && SettingsStore.isEnabled("blacklistUnverifiedDevices")) {
+ encryptionSettings =
;
}
return (
diff --git a/src/components/views/settings/tabs/user/AppearanceUserSettingsTab.tsx b/src/components/views/settings/tabs/user/AppearanceUserSettingsTab.tsx
index b4c05a2ecb..9f9acd8e3c 100644
--- a/src/components/views/settings/tabs/user/AppearanceUserSettingsTab.tsx
+++ b/src/components/views/settings/tabs/user/AppearanceUserSettingsTab.tsx
@@ -36,6 +36,7 @@ import EventTilePreview from '../../../elements/EventTilePreview';
import StyledRadioGroup from "../../../elements/StyledRadioGroup";
import classNames from 'classnames';
import { SettingLevel } from "../../../../../settings/SettingLevel";
+import {UIFeature} from "../../../../../settings/UIFeature";
interface IProps {
}
@@ -386,6 +387,8 @@ export default class AppearanceUserSettingsTab extends React.Component
:
: null;
+ let accountManagementSection;
+ if (SettingsStore.getValue(UIFeature.Deactivate)) {
+ accountManagementSection = <>
+
{_t("Deactivate account")}
+ {this._renderManagementSection()}
+ >;
+ }
+
+ let discoverySection;
+ if (SettingsStore.getValue(UIFeature.IdentityServer)) {
+ discoverySection = <>
+
{discoWarning} {_t("Discovery")}
+ {this._renderDiscoverySection()}
+ >;
+ }
+
return (
{_t("General")}
{this._renderProfileSection()}
{this._renderAccountSection()}
{this._renderLanguageSection()}
-
{discoWarning} {_t("Discovery")}
- {this._renderDiscoverySection()}
+ { discoverySection }
{this._renderIntegrationManagerSection() /* Has its own title */}
-
{_t("Deactivate account")}
- {this._renderManagementSection()}
+ { accountManagementSection }
);
}
diff --git a/src/components/views/settings/tabs/user/HelpUserSettingsTab.js b/src/components/views/settings/tabs/user/HelpUserSettingsTab.js
index 64807ddb21..85ba22a353 100644
--- a/src/components/views/settings/tabs/user/HelpUserSettingsTab.js
+++ b/src/components/views/settings/tabs/user/HelpUserSettingsTab.js
@@ -204,9 +204,9 @@ export default class HelpUserSettingsTab extends React.Component {
updateButton =
;
}
- return (
-
-
{_t("Help & About")}
+ let bugReportingSection;
+ if (SdkConfig.get().bug_report_endpoint_url) {
+ bugReportingSection = (
{_t('Bug reporting')}
@@ -223,22 +223,24 @@ export default class HelpUserSettingsTab extends React.Component {
{_t("Submit debug logs")}
-
-
- {_t("Clear cache and reload")}
-
-
{
_t( "To report a Matrix-related security issue, please read the Matrix.org " +
"
Security Disclosure Policy.", {},
{
'a': (sub) =>
{sub},
+ rel="noreferrer noopener" target="_blank">{sub},
})
}
+ );
+ }
+
+ return (
+
+
{_t("Help & About")}
+ { bugReportingSection }
{_t("FAQ")}
@@ -268,6 +270,11 @@ export default class HelpUserSettingsTab extends React.Component {
data-spoiler={MatrixClientPeg.get().getAccessToken()}>
<{ _t("click to reveal") }>
+
+
+ {_t("Clear cache and reload")}
+
+
diff --git a/src/components/views/settings/tabs/user/PreferencesUserSettingsTab.js b/src/components/views/settings/tabs/user/PreferencesUserSettingsTab.js
index a77815a68c..bba337ee85 100644
--- a/src/components/views/settings/tabs/user/PreferencesUserSettingsTab.js
+++ b/src/components/views/settings/tabs/user/PreferencesUserSettingsTab.js
@@ -49,11 +49,10 @@ export default class PreferencesUserSettingsTab extends React.Component {
'showAvatarChanges',
'showDisplaynameChanges',
'showImages',
+ 'Pill.shouldShowPillAvatar',
];
- static ADVANCED_SETTINGS = [
- 'alwaysShowEncryptionIcons',
- 'Pill.shouldShowPillAvatar',
+ static GENERAL_SETTINGS = [
'TagPanel.enableTagPanel',
'promptBeforeInviteUnknownUsers',
// Start automatically after startup (electron-only)
@@ -139,7 +138,9 @@ export default class PreferencesUserSettingsTab extends React.Component {
_renderGroup(settingIds) {
const SettingsFlag = sdk.getComponent("views.elements.SettingsFlag");
- return settingIds.map(i =>
);
+ return settingIds.filter(SettingsStore.isEnabled).map(i => {
+ return
;
+ });
}
render() {
@@ -187,8 +188,8 @@ export default class PreferencesUserSettingsTab extends React.Component {
-
{_t("Advanced")}
- {this._renderGroup(PreferencesUserSettingsTab.ADVANCED_SETTINGS)}
+
{_t("General")}
+ {this._renderGroup(PreferencesUserSettingsTab.GENERAL_SETTINGS)}
{minimizeToTrayOption}
{autoHideMenuOption}
{autoLaunchOption}
diff --git a/src/components/views/settings/tabs/user/SecurityUserSettingsTab.js b/src/components/views/settings/tabs/user/SecurityUserSettingsTab.js
index 90dcc0b658..61402e8881 100644
--- a/src/components/views/settings/tabs/user/SecurityUserSettingsTab.js
+++ b/src/components/views/settings/tabs/user/SecurityUserSettingsTab.js
@@ -29,6 +29,10 @@ import {sleep} from "../../../../../utils/promise";
import dis from "../../../../../dispatcher/dispatcher";
import {privateShouldBeEncrypted} from "../../../../../createRoom";
import {SettingLevel} from "../../../../../settings/SettingLevel";
+import SecureBackupPanel from "../../SecureBackupPanel";
+import SettingsStore from "../../../../../settings/SettingsStore";
+import {UIFeature} from "../../../../../settings/UIFeature";
+import {isE2eAdvancedPanelPossible} from "../../E2eAdvancedPanel";
export class IgnoredUser extends React.Component {
static propTypes = {
@@ -102,14 +106,14 @@ export default class SecurityUserSettingsTab extends React.Component {
_onExportE2eKeysClicked = () => {
Modal.createTrackedDialogAsync('Export E2E Keys', '',
- import('../../../../../async-components/views/dialogs/ExportE2eKeysDialog'),
+ import('../../../../../async-components/views/dialogs/security/ExportE2eKeysDialog'),
{matrixClient: MatrixClientPeg.get()},
);
};
_onImportE2eKeysClicked = () => {
Modal.createTrackedDialogAsync('Import E2E Keys', '',
- import('../../../../../async-components/views/dialogs/ImportE2eKeysDialog'),
+ import('../../../../../async-components/views/dialogs/security/ImportE2eKeysDialog'),
{matrixClient: MatrixClientPeg.get()},
);
};
@@ -216,6 +220,15 @@ export default class SecurityUserSettingsTab extends React.Component {
);
}
+ let noSendUnverifiedSetting;
+ if (SettingsStore.isEnabled("blacklistUnverifiedDevices")) {
+ noSendUnverifiedSetting =
;
+ }
+
return (
{_t("Cryptography")}
@@ -230,8 +243,7 @@ export default class SecurityUserSettingsTab extends React.Component {
{importExportButtons}
-
+ {noSendUnverifiedSetting}
);
}
@@ -288,12 +300,11 @@ export default class SecurityUserSettingsTab extends React.Component {
const SettingsFlag = sdk.getComponent('views.elements.SettingsFlag');
const EventIndexPanel = sdk.getComponent('views.settings.EventIndexPanel');
- const KeyBackupPanel = sdk.getComponent('views.settings.KeyBackupPanel');
- const keyBackup = (
+ const secureBackup = (
-
{_t("Key backup")}
+
{_t("Secure Backup")}
-
+
);
@@ -311,15 +322,13 @@ export default class SecurityUserSettingsTab extends React.Component {
// can remove this.
const CrossSigningPanel = sdk.getComponent('views.settings.CrossSigningPanel');
const crossSigning = (
-
-
{_t("Cross-signing")}
-
-
-
+
+
{_t("Cross-signing")}
+
+
- );
-
- const E2eAdvancedPanel = sdk.getComponent('views.settings.E2eAdvancedPanel');
+
+ );
let warning;
if (!privateShouldBeEncrypted()) {
@@ -329,6 +338,48 @@ export default class SecurityUserSettingsTab extends React.Component {
;
}
+ let privacySection;
+ if (Analytics.canEnable()) {
+ privacySection =
+ {_t("Privacy")}
+
+
{_t("Analytics")}
+
+ {_t(
+ "%(brand)s collects anonymous analytics to allow us to improve the application.",
+ { brand },
+ )}
+
+ {_t("Privacy is important to us, so we don't collect any personal or " +
+ "identifiable data for our analytics.")}
+
+ {_t("Learn more about how we use analytics.")}
+
+
+
+
+ ;
+ }
+
+ const E2eAdvancedPanel = sdk.getComponent('views.settings.E2eAdvancedPanel');
+ let advancedSection;
+ if (SettingsStore.getValue(UIFeature.AdvancedSettings)) {
+ const ignoreUsersPanel = this._renderIgnoredUsers();
+ const invitesPanel = this._renderManageInvites();
+ const e2ePanel = isE2eAdvancedPanelPossible() ?
: null;
+ // only show the section if there's something to show
+ if (ignoreUsersPanel || invitesPanel || e2ePanel) {
+ advancedSection = <>
+
{_t("Advanced")}
+
+ {ignoreUsersPanel}
+ {invitesPanel}
+ {e2ePanel}
+
+ >;
+ }
+ }
+
return (
{warning}
@@ -352,35 +403,13 @@ export default class SecurityUserSettingsTab extends React.Component {
{_t("Encryption")}
- {keyBackup}
+ {secureBackup}
{eventIndex}
{crossSigning}
{this._renderCurrentDeviceInfo()}
-
{_t("Privacy")}
-
-
{_t("Analytics")}
-
- {_t(
- "%(brand)s collects anonymous analytics to allow us to improve the application.",
- { brand },
- )}
-
- {_t("Privacy is important to us, so we don't collect any personal or " +
- "identifiable data for our analytics.")}
-
- {_t("Learn more about how we use analytics.")}
-
-
-
-
-
{_t("Advanced")}
-
- {this._renderIgnoredUsers()}
- {this._renderManageInvites()}
-
-
+ { privacySection }
+ { advancedSection }
);
}
diff --git a/src/contexts/RoomContext.ts b/src/contexts/RoomContext.ts
new file mode 100644
index 0000000000..e8eb0c23b4
--- /dev/null
+++ b/src/contexts/RoomContext.ts
@@ -0,0 +1,48 @@
+/*
+Copyright 2019 The Matrix.org Foundation C.I.C.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+import { createContext } from "react";
+
+import {IState} from "../components/structures/RoomView";
+
+const RoomContext = createContext