From 1c7ec11a89448e53118c743880e29b8a6b33e4fa Mon Sep 17 00:00:00 2001 From: Krille Fear Date: Fri, 19 Nov 2021 19:36:26 +0100 Subject: [PATCH] fix: Remove dead code --- assets/l10n/intl_en.arb | 5 --- lib/pages/settings/settings.dart | 59 -------------------------------- 2 files changed, 64 deletions(-) diff --git a/assets/l10n/intl_en.arb b/assets/l10n/intl_en.arb index cc523a62..92bd28dc 100644 --- a/assets/l10n/intl_en.arb +++ b/assets/l10n/intl_en.arb @@ -128,11 +128,6 @@ "type": "text", "placeholders": {} }, - "askSSSSCache": "Please enter your secure store passphrase or recovery key to cache the keys.", - "@askSSSSCache": { - "type": "text", - "placeholders": {} - }, "askSSSSSign": "To be able to sign the other person, please enter your secure store passphrase or recovery key.", "@askSSSSSign": { "type": "text", diff --git a/lib/pages/settings/settings.dart b/lib/pages/settings/settings.dart index ef6afdc4..b0a43da4 100644 --- a/lib/pages/settings/settings.dart +++ b/lib/pages/settings/settings.dart @@ -11,7 +11,6 @@ import 'package:image_picker/image_picker.dart'; import 'package:matrix/matrix.dart'; import 'package:fluffychat/utils/platform_infos.dart'; -import 'package:fluffychat/utils/sentry_controller.dart'; import '../../widgets/matrix.dart'; import 'settings_view.dart'; @@ -109,64 +108,6 @@ class SettingsController extends State { } } - Future requestSSSSCache() async { - final handle = Matrix.of(context).client.encryption.ssss.open(); - final input = await showTextInputDialog( - useRootNavigator: false, - context: context, - title: L10n.of(context).askSSSSCache, - okLabel: L10n.of(context).ok, - cancelLabel: L10n.of(context).cancel, - textFields: [ - DialogTextField( - hintText: L10n.of(context).passphraseOrKey, - obscureText: true, - minLines: 1, - maxLines: 1, - ) - ], - ); - if (input != null) { - final valid = await showFutureLoadingDialog( - context: context, - future: () async { - // make sure the loading spinner shows before we test the keys - await Future.delayed(const Duration(milliseconds: 100)); - var valid = false; - try { - await handle.unlock(recoveryKey: input.single); - valid = true; - } catch (e, s) { - SentryController.captureException(e, s); - } - return valid; - }); - - if (valid.result == true) { - await handle.maybeCacheAll(); - await showOkAlertDialog( - useRootNavigator: false, - context: context, - message: L10n.of(context).cachedKeys, - okLabel: L10n.of(context).ok, - ); - setState(() { - crossSigningCachedFuture = null; - crossSigningCached = null; - megolmBackupCachedFuture = null; - megolmBackupCached = null; - }); - } else { - await showOkAlertDialog( - useRootNavigator: false, - context: context, - message: L10n.of(context).incorrectPassphraseOrKey, - okLabel: L10n.of(context).ok, - ); - } - } - } - @override Widget build(BuildContext context) { final client = Matrix.of(context).client;