{ !this.state.serverSupportsControlOfDevicesLogout ? + _t( + "Resetting your password on this homeserver will cause all of your devices to be " + + "signed out. This will delete the message encryption keys stored on them, " + + "making encrypted chat history unreadable.", + ) : + _t( + "Signing out your devices will delete the message encryption keys stored on them, " + + "making encrypted chat history unreadable.", + ) + }
+{ _t( + "If you want to retain access to your chat history in encrypted rooms, set up Key Backup " + + "or export your message keys from one of your other devices before proceeding.", + ) }
+{ _t("Your password has been reset.") }
-{ _t( - "You have been logged out of all sessions and will no longer receive " + - "push notifications. To re-enable notifications, sign in again on each " + - "device.", - ) }
+ { this.state.logoutDevices ? +{ _t( + "You have been logged out of all devices and will no longer receive " + + "push notifications. To re-enable notifications, sign in again on each " + + "device.", + ) }
+ : null + } 'm.login.password': this.renderPasswordStep, // CAS and SSO are the same thing, modulo the url we link to + // eslint-disable-next-line @typescript-eslint/naming-convention 'm.login.cas': () => this.renderSsoStep("cas"), + // eslint-disable-next-line @typescript-eslint/naming-convention 'm.login.sso': () => this.renderSsoStep("sso"), }; } diff --git a/src/components/structures/auth/Registration.tsx b/src/components/structures/auth/Registration.tsx index ecb4691e1b6..ff7e41b9d58 100644 --- a/src/components/structures/auth/Registration.tsx +++ b/src/components/structures/auth/Registration.tsx @@ -110,7 +110,9 @@ interface IState { } export default class Registration extends React.Component{ _t( - "This will make your account permanently unusable. " + - "You will not be able to log in, and no one will be able to re-register the same " + - "user ID. " + - "This will cause your account to leave all rooms it is participating in, and it " + - "will remove your account details from your identity server. " + - "This action is irreversible.", - {}, - { b: (sub) => { sub } }, - ) }
- -{ _t( - "Deactivating your account does not by default cause us to forget messages you " + - "have sent. " + - "If you would like us to forget your messages, please tick the box below.", - {}, - { b: (sub) => { sub } }, - ) }
- -{ _t( - "Message visibility in Matrix is similar to email. " + - "Our forgetting your messages means that messages you have sent will not be shared " + - "with any new or unregistered users, but registered users who already have access " + - "to these messages will still have access to their copy.", - ) }
+{ _t("Confirm that you would like to deactivate your account. If you proceed:") }
+{ _t("Your old messages will still be visible to people who received them, just like emails you sent in the past. Would you like to hide your sent messages from people who join rooms in the future?") }
@@ -238,20 +222,12 @@ export default class DeactivateAccountDialog extends React.Component
+ { _t( + 'Please note: this is a labs feature using a temporary implementation. ' + + 'This means you will not be able to delete your location history, ' + + 'and advanced users will be able to see your location history ' + + 'even after you stop sharing your live location with this room.', + ) } +
+{ _t( + 'Changing your password on this homeserver will cause all of your other devices to be ' + + 'signed out. This will delete the message encryption keys stored on them, and may make ' + + 'encrypted chat history unreadable.', + ) }
+{ _t( + 'If you want to retain access to your chat history in encrypted rooms you should first ' + + 'export your room keys and re-import them afterwards.', + ) }
+{ _t( + 'You can also ask your homeserver admin to upgrade the server to change this behaviour.', + ) }
+/plain
to send without markdown and /md
to send with.",
+ {},
+ { code: (sub) => { sub }
},
+ ),
+ default: true,
+ },
"VideoView.flipVideoHorizontally": {
supportedLevels: LEVELS_ACCOUNT_SETTINGS,
displayName: _td('Mirror local video feed'),
diff --git a/src/settings/SettingsStore.ts b/src/settings/SettingsStore.ts
index 95ea0e6993e..19a419afb7f 100644
--- a/src/settings/SettingsStore.ts
+++ b/src/settings/SettingsStore.ts
@@ -16,6 +16,7 @@ limitations under the License.
*/
import { logger } from "matrix-js-sdk/src/logger";
+import { ReactNode } from "react";
import DeviceSettingsHandler from "./handlers/DeviceSettingsHandler";
import RoomDeviceSettingsHandler from "./handlers/RoomDeviceSettingsHandler";
@@ -257,9 +258,11 @@ export default class SettingsStore {
* @param {string} settingName The setting to look up.
* @return {String} The description for the setting, or null if not found.
*/
- public static getDescription(settingName: string) {
- if (!SETTINGS[settingName]?.description) return null;
- return _t(SETTINGS[settingName].description);
+ public static getDescription(settingName: string): string | ReactNode {
+ const description = SETTINGS[settingName]?.description;
+ if (!description) return null;
+ if (typeof description !== 'string') return description();
+ return _t(description);
}
/**
diff --git a/src/settings/handlers/AbstractLocalStorageSettingsHandler.ts b/src/settings/handlers/AbstractLocalStorageSettingsHandler.ts
new file mode 100644
index 00000000000..07fa907a90e
--- /dev/null
+++ b/src/settings/handlers/AbstractLocalStorageSettingsHandler.ts
@@ -0,0 +1,111 @@
+/*
+Copyright 2019 - 2022 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 SettingsHandler from "./SettingsHandler";
+
+/**
+ * Abstract settings handler wrapping around localStorage making getValue calls cheaper
+ * by caching the values and listening for localStorage updates from other tabs.
+ */
+export default abstract class AbstractLocalStorageSettingsHandler extends SettingsHandler {
+ // Shared cache between all subclass instances
+ private static itemCache = new Map