From 043f1ab3f08c2ba2d783b822d4019adfba5194d6 Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 8 Feb 2019 16:58:09 +0000 Subject: [PATCH 1/4] Remove key backup & sas from labs --- src/components/structures/RoomView.js | 1 - .../views/dialogs/DeviceVerifyDialog.js | 2 +- src/components/views/dialogs/LogoutDialog.js | 115 +++++++----------- .../settings/tabs/SecuritySettingsTab.js | 19 ++- src/settings/Settings.js | 12 -- 5 files changed, 53 insertions(+), 96 deletions(-) diff --git a/src/components/structures/RoomView.js b/src/components/structures/RoomView.js index 4778f1a76a0..50fa18e075c 100644 --- a/src/components/structures/RoomView.js +++ b/src/components/structures/RoomView.js @@ -1635,7 +1635,6 @@ module.exports = React.createClass({ ); const showRoomRecoveryReminder = ( - SettingsStore.isFeatureEnabled("feature_keybackup") && SettingsStore.getValue("showRoomRecoveryReminder") && MatrixClientPeg.get().isRoomEncrypted(this.state.room.roomId) && !MatrixClientPeg.get().getKeyBackupEnabled() diff --git a/src/components/views/dialogs/DeviceVerifyDialog.js b/src/components/views/dialogs/DeviceVerifyDialog.js index d0643a60c4f..72f094e1e56 100644 --- a/src/components/views/dialogs/DeviceVerifyDialog.js +++ b/src/components/views/dialogs/DeviceVerifyDialog.js @@ -48,7 +48,7 @@ export default class DeviceVerifyDialog extends React.Component { this._showSasEvent = null; this.state = { phase: PHASE_START, - mode: SettingsStore.isFeatureEnabled("feature_sas") ? MODE_SAS : MODE_LEGACY, + mode: MODE_SAS, sasVerified: false, }; } diff --git a/src/components/views/dialogs/LogoutDialog.js b/src/components/views/dialogs/LogoutDialog.js index 1f81472cc01..2707ff33f92 100644 --- a/src/components/views/dialogs/LogoutDialog.js +++ b/src/components/views/dialogs/LogoutDialog.js @@ -79,86 +79,59 @@ export default class LogoutDialog extends React.Component { } render() { - let description; - if (SettingsStore.isFeatureEnabled("feature_keybackup")) { - description =
-

{_t( - "When you log out, you'll lose your secure message history. To prevent " + - "this, set up a recovery method.", - )}

-

{_t( - "Alternatively, advanced users can also manually export encryption keys in " + - "Settings before logging out.", {}, - { - a: sub => {sub}, - }, - )}

-
; - } else { - description =
{_t( - "For security, logging out will delete any end-to-end " + - "encryption keys from this browser. If you want to be able " + - "to decrypt your conversation history from future Riot sessions, " + - "please export your room keys for safe-keeping.", - )}
; - } + const description =
+

{_t( + "When you log out, you'll lose your secure message history. To prevent " + + "this, set up a recovery method.", + )}

+

{_t( + "Alternatively, advanced users can also manually export encryption keys in " + + "Settings before logging out.", {}, + { + a: sub => {sub}, + }, + )}

+
; - if (SettingsStore.isFeatureEnabled("feature_keybackup")) { - if (!MatrixClientPeg.get().getKeyBackupEnabled()) { - const BaseDialog = sdk.getComponent('views.dialogs.BaseDialog'); - const DialogButtons = sdk.getComponent('views.elements.DialogButtons'); - // Not quite a standard question dialog as the primary button cancels - // the action and does something else instead, whilst non-default button - // confirms the action. - return ( +
+ { description } +
+ -
- { description } -
- - - -
); - } else { - const QuestionDialog = sdk.getComponent('views.dialogs.QuestionDialog'); - return (); - } + + + ); } else { const QuestionDialog = sdk.getComponent('views.dialogs.QuestionDialog'); return ( - { _t("Export E2E room keys") } - ), - ]} onFinished={this._onFinished} />); } diff --git a/src/components/views/settings/tabs/SecuritySettingsTab.js b/src/components/views/settings/tabs/SecuritySettingsTab.js index a2a30a2190a..0f05376e54a 100644 --- a/src/components/views/settings/tabs/SecuritySettingsTab.js +++ b/src/components/views/settings/tabs/SecuritySettingsTab.js @@ -196,18 +196,15 @@ export default class SecuritySettingsTab extends React.Component { const DevicesPanel = sdk.getComponent('views.settings.DevicesPanel'); const SettingsFlag = sdk.getComponent('views.elements.SettingsFlag'); - let keyBackup = null; - if (SettingsStore.isFeatureEnabled("feature_keybackup")) { - const KeyBackupPanel = sdk.getComponent('views.settings.KeyBackupPanel'); - keyBackup = ( -
- {_t("Key backup")} -
- -
+ const KeyBackupPanel = sdk.getComponent('views.settings.KeyBackupPanel'); + const keyBackup = ( +
+ {_t("Key backup")} +
+
- ); - } +
+ ); return (
diff --git a/src/settings/Settings.js b/src/settings/Settings.js index 02c2bad14b8..9dfbc7d51ea 100644 --- a/src/settings/Settings.js +++ b/src/settings/Settings.js @@ -105,24 +105,12 @@ export const SETTINGS = { supportedLevels: LEVELS_FEATURE, default: false, }, - "feature_keybackup": { - isFeature: true, - displayName: _td("Backup of encryption keys to server"), - supportedLevels: LEVELS_FEATURE, - default: false, - }, "feature_state_counters": { isFeature: true, displayName: _td("Render simple counters in room header"), supportedLevels: LEVELS_FEATURE, default: false, }, - "feature_sas": { - isFeature: true, - displayName: _td("Two-way device verification using short text"), - supportedLevels: LEVELS_FEATURE, - default: false, - }, "MessageComposerInput.suggestEmoji": { supportedLevels: LEVELS_ACCOUNT_SETTINGS, displayName: _td('Enable Emoji suggestions while typing'), From e06a68501a22d7ae288add3205386c2a042e3605 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Fri, 8 Feb 2019 17:23:18 +0000 Subject: [PATCH 2/4] Typo Co-Authored-By: dbkr --- src/components/views/dialogs/LogoutDialog.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/views/dialogs/LogoutDialog.js b/src/components/views/dialogs/LogoutDialog.js index 2707ff33f92..3df7af1851e 100644 --- a/src/components/views/dialogs/LogoutDialog.js +++ b/src/components/views/dialogs/LogoutDialog.js @@ -124,7 +124,7 @@ export default class LogoutDialog extends React.Component { hasCancelButton={true} title={_t("Sign out")} // TODO: This is made up by me and would need to also mention verifying - // once you can restorew a backup by verifying a device + // once you can restore a backup by verifying a device description={_t( "When signing in again, you can access encrypted chat history by " + "restoring your key backup. You'll need your recovery passphrase " + From cedefcfb3301499015f0c4d50b189f833ac51865 Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 8 Feb 2019 17:24:15 +0000 Subject: [PATCH 3/4] re-run i18n --- src/i18n/strings/en_EN.json | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index c2f19cbdd24..d5ec9d14c76 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -271,9 +271,7 @@ "Message Pinning": "Message Pinning", "Custom user status messages": "Custom user status messages", "Group & filter rooms by custom tags (refresh to apply changes)": "Group & filter rooms by custom tags (refresh to apply changes)", - "Backup of encryption keys to server": "Backup of encryption keys to server", "Render simple counters in room header": "Render simple counters in room header", - "Two-way device verification using short text": "Two-way device verification using short text", "Enable Emoji suggestions while typing": "Enable Emoji suggestions while typing", "Use compact timeline layout": "Use compact timeline layout", "Show a placeholder for removed messages": "Show a placeholder for removed messages", @@ -372,7 +370,7 @@ "Robot": "Robot", "Hat": "Hat", "Glasses": "Glasses", - "Wrench": "Wrench", + "Spanner": "Spanner", "Santa": "Santa", "Thumbs up": "Thumbs up", "Umbrella": "Umbrella", @@ -1105,7 +1103,6 @@ "Updating Riot": "Updating Riot", "When you log out, you'll lose your secure message history. To prevent this, set up a recovery method.": "When you log out, you'll lose your secure message history. To prevent this, set up a recovery method.", "Alternatively, advanced users can also manually export encryption keys in Settings before logging out.": "Alternatively, advanced users can also manually export encryption keys in Settings before logging out.", - "For security, logging out will delete any end-to-end encryption keys from this browser. If you want to be able to decrypt your conversation history from future Riot sessions, please export your room keys for safe-keeping.": "For security, logging out will delete any end-to-end encryption keys from this browser. If you want to be able to decrypt your conversation history from future Riot sessions, please export your room keys for safe-keeping.", "Set a Recovery Method": "Set a Recovery Method", "I understand, log out without": "I understand, log out without", "When signing in again, you can access encrypted chat history by restoring your key backup. You'll need your recovery passphrase or, if you didn't set a recovery passphrase, your recovery key (that you downloaded).": "When signing in again, you can access encrypted chat history by restoring your key backup. You'll need your recovery passphrase or, if you didn't set a recovery passphrase, your recovery key (that you downloaded).", From d74d5f1e27e656ae538b5f2eeffeeffe99524537 Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 8 Feb 2019 17:30:14 +0000 Subject: [PATCH 4/4] Fix unused imports --- src/components/views/dialogs/DeviceVerifyDialog.js | 1 - src/components/views/dialogs/LogoutDialog.js | 1 - src/components/views/settings/tabs/SecuritySettingsTab.js | 2 +- 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/components/views/dialogs/DeviceVerifyDialog.js b/src/components/views/dialogs/DeviceVerifyDialog.js index 72f094e1e56..47ee73c61c7 100644 --- a/src/components/views/dialogs/DeviceVerifyDialog.js +++ b/src/components/views/dialogs/DeviceVerifyDialog.js @@ -22,7 +22,6 @@ import MatrixClientPeg from '../../../MatrixClientPeg'; import sdk from '../../../index'; import * as FormattingUtils from '../../../utils/FormattingUtils'; import { _t } from '../../../languageHandler'; -import SettingsStore from '../../../settings/SettingsStore'; import {verificationMethods} from 'matrix-js-sdk/lib/crypto'; const MODE_LEGACY = 'legacy'; diff --git a/src/components/views/dialogs/LogoutDialog.js b/src/components/views/dialogs/LogoutDialog.js index 3df7af1851e..16b92af1c85 100644 --- a/src/components/views/dialogs/LogoutDialog.js +++ b/src/components/views/dialogs/LogoutDialog.js @@ -20,7 +20,6 @@ import sdk from '../../../index'; import dis from '../../../dispatcher'; import { _t } from '../../../languageHandler'; import MatrixClientPeg from '../../../MatrixClientPeg'; -import SettingsStore from "../../../settings/SettingsStore"; export default class LogoutDialog extends React.Component { constructor() { diff --git a/src/components/views/settings/tabs/SecuritySettingsTab.js b/src/components/views/settings/tabs/SecuritySettingsTab.js index 0f05376e54a..b64313e0823 100644 --- a/src/components/views/settings/tabs/SecuritySettingsTab.js +++ b/src/components/views/settings/tabs/SecuritySettingsTab.js @@ -17,7 +17,7 @@ limitations under the License. import React from 'react'; import PropTypes from 'prop-types'; import {_t} from "../../../../languageHandler"; -import SettingsStore, {SettingLevel} from "../../../../settings/SettingsStore"; +import {SettingLevel} from "../../../../settings/SettingsStore"; import MatrixClientPeg from "../../../../MatrixClientPeg"; import * as FormattingUtils from "../../../../utils/FormattingUtils"; import AccessibleButton from "../../elements/AccessibleButton";