refactor: Remove unused feature tor browser detector
This commit is contained in:
parent
dd3c65a577
commit
a445ec4b43
7 changed files with 0 additions and 90 deletions
|
|
@ -1,6 +1,5 @@
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:flutter/foundation.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
|
|
||||||
|
|
@ -31,9 +30,6 @@ import '../../utils/url_launcher.dart';
|
||||||
import '../../widgets/matrix.dart';
|
import '../../widgets/matrix.dart';
|
||||||
import '../bootstrap/bootstrap_dialog.dart';
|
import '../bootstrap/bootstrap_dialog.dart';
|
||||||
|
|
||||||
import 'package:fluffychat/utils/tor_stub.dart'
|
|
||||||
if (dart.library.html) 'package:tor_detector_web/tor_detector_web.dart';
|
|
||||||
|
|
||||||
enum PopupMenuAction {
|
enum PopupMenuAction {
|
||||||
settings,
|
settings,
|
||||||
invite,
|
invite,
|
||||||
|
|
@ -301,8 +297,6 @@ class ChatListController extends State<ChatList>
|
||||||
if (unfocus) searchFocusNode.unfocus();
|
if (unfocus) searchFocusNode.unfocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isTorBrowser = false;
|
|
||||||
|
|
||||||
BoxConstraints? snappingSheetContainerSize;
|
BoxConstraints? snappingSheetContainerSize;
|
||||||
|
|
||||||
final ScrollController scrollController = ScrollController();
|
final ScrollController scrollController = ScrollController();
|
||||||
|
|
@ -421,8 +415,6 @@ class ChatListController extends State<ChatList>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
_checkTorBrowser();
|
|
||||||
|
|
||||||
super.initState();
|
super.initState();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -910,12 +902,6 @@ class ChatListController extends State<ChatList>
|
||||||
ChatList.contextForVoip = context;
|
ChatList.contextForVoip = context;
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _checkTorBrowser() async {
|
|
||||||
if (!kIsWeb) return;
|
|
||||||
final isTor = await TorBrowserDetector.isTorBrowser;
|
|
||||||
isTorBrowser = isTor;
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<void> dehydrate() => Matrix.of(context).dehydrateAction(context);
|
Future<void> dehydrate() => Matrix.of(context).dehydrateAction(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -128,23 +128,6 @@ class ChatListViewBody extends StatelessWidget {
|
||||||
onStatusEdit: controller.setStatus,
|
onStatusEdit: controller.setStatus,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
AnimatedContainer(
|
|
||||||
height: controller.isTorBrowser ? 64 : 0,
|
|
||||||
duration: FluffyThemes.animationDuration,
|
|
||||||
curve: FluffyThemes.animationCurve,
|
|
||||||
clipBehavior: Clip.hardEdge,
|
|
||||||
decoration: const BoxDecoration(),
|
|
||||||
child: Material(
|
|
||||||
color: theme.colorScheme.surface,
|
|
||||||
child: ListTile(
|
|
||||||
leading: const Icon(Icons.vpn_key),
|
|
||||||
title: Text(L10n.of(context).dehydrateTor),
|
|
||||||
subtitle: Text(L10n.of(context).dehydrateTorLong),
|
|
||||||
trailing: const Icon(Icons.chevron_right_outlined),
|
|
||||||
onTap: controller.dehydrate,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
if (client.rooms.isNotEmpty && !controller.isSearchMode)
|
if (client.rooms.isNotEmpty && !controller.isSearchMode)
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 64,
|
height: 64,
|
||||||
|
|
|
||||||
|
|
@ -20,9 +20,6 @@ import 'package:fluffychat/widgets/adaptive_dialogs/show_ok_cancel_alert_dialog.
|
||||||
import 'package:fluffychat/widgets/matrix.dart';
|
import 'package:fluffychat/widgets/matrix.dart';
|
||||||
import '../../utils/localized_exception_extension.dart';
|
import '../../utils/localized_exception_extension.dart';
|
||||||
|
|
||||||
import 'package:fluffychat/utils/tor_stub.dart'
|
|
||||||
if (dart.library.html) 'package:tor_detector_web/tor_detector_web.dart';
|
|
||||||
|
|
||||||
class HomeserverPicker extends StatefulWidget {
|
class HomeserverPicker extends StatefulWidget {
|
||||||
final bool addMultiAccount;
|
final bool addMultiAccount;
|
||||||
const HomeserverPicker({required this.addMultiAccount, super.key});
|
const HomeserverPicker({required this.addMultiAccount, super.key});
|
||||||
|
|
@ -40,15 +37,6 @@ class HomeserverPickerController extends State<HomeserverPicker> {
|
||||||
|
|
||||||
String? error;
|
String? error;
|
||||||
|
|
||||||
bool isTorBrowser = false;
|
|
||||||
|
|
||||||
Future<void> _checkTorBrowser() async {
|
|
||||||
if (!kIsWeb) return;
|
|
||||||
|
|
||||||
final isTor = await TorBrowserDetector.isTorBrowser;
|
|
||||||
isTorBrowser = isTor;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Starts an analysis of the given homeserver. It uses the current domain and
|
/// Starts an analysis of the given homeserver. It uses the current domain and
|
||||||
/// makes sure that it is prefixed with https. Then it searches for the
|
/// makes sure that it is prefixed with https. Then it searches for the
|
||||||
/// well-known information and forwards to the login page depending on the
|
/// well-known information and forwards to the login page depending on the
|
||||||
|
|
@ -173,12 +161,6 @@ class HomeserverPickerController extends State<HomeserverPicker> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
|
||||||
void initState() {
|
|
||||||
_checkTorBrowser();
|
|
||||||
super.initState();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) => HomeserverPickerView(this);
|
Widget build(BuildContext context) => HomeserverPickerView(this);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,6 @@ import 'package:fluffychat/l10n/l10n.dart';
|
||||||
import 'package:fluffychat/widgets/adaptive_dialogs/adaptive_dialog_action.dart';
|
import 'package:fluffychat/widgets/adaptive_dialogs/adaptive_dialog_action.dart';
|
||||||
import 'package:fluffychat/widgets/layouts/login_scaffold.dart';
|
import 'package:fluffychat/widgets/layouts/login_scaffold.dart';
|
||||||
import 'package:fluffychat/widgets/matrix.dart';
|
import 'package:fluffychat/widgets/matrix.dart';
|
||||||
import '../../config/themes.dart';
|
|
||||||
import 'homeserver_picker.dart';
|
import 'homeserver_picker.dart';
|
||||||
|
|
||||||
class HomeserverPickerView extends StatelessWidget {
|
class HomeserverPickerView extends StatelessWidget {
|
||||||
|
|
@ -85,30 +84,6 @@ class HomeserverPickerView extends StatelessWidget {
|
||||||
child: IntrinsicHeight(
|
child: IntrinsicHeight(
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
// display a prominent banner to import session for TOR browser
|
|
||||||
// users. This feature is just some UX sugar as TOR users are
|
|
||||||
// usually forced to logout as TOR browser is non-persistent
|
|
||||||
AnimatedContainer(
|
|
||||||
height: controller.isTorBrowser ? 64 : 0,
|
|
||||||
duration: FluffyThemes.animationDuration,
|
|
||||||
curve: FluffyThemes.animationCurve,
|
|
||||||
clipBehavior: Clip.hardEdge,
|
|
||||||
decoration: const BoxDecoration(),
|
|
||||||
child: Material(
|
|
||||||
clipBehavior: Clip.hardEdge,
|
|
||||||
borderRadius: const BorderRadius.vertical(
|
|
||||||
bottom: Radius.circular(8),
|
|
||||||
),
|
|
||||||
color: theme.colorScheme.surface,
|
|
||||||
child: ListTile(
|
|
||||||
leading: const Icon(Icons.vpn_key),
|
|
||||||
title: Text(L10n.of(context).hydrateTor),
|
|
||||||
subtitle: Text(L10n.of(context).hydrateTorLong),
|
|
||||||
trailing: const Icon(Icons.chevron_right_outlined),
|
|
||||||
onTap: controller.restoreBackup,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Container(
|
Container(
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 8.0),
|
padding: const EdgeInsets.symmetric(horizontal: 8.0),
|
||||||
|
|
|
||||||
|
|
@ -1,7 +0,0 @@
|
||||||
/// Stub class for [TorBrowserDetector]
|
|
||||||
///
|
|
||||||
/// statically returns false as Tor **browser** can only be detected in a
|
|
||||||
/// **browser**.
|
|
||||||
abstract class TorBrowserDetector {
|
|
||||||
static Future<bool> get isTorBrowser => Future.value(false);
|
|
||||||
}
|
|
||||||
|
|
@ -1897,14 +1897,6 @@ packages:
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.1"
|
version: "2.0.1"
|
||||||
tor_detector_web:
|
|
||||||
dependency: "direct main"
|
|
||||||
description:
|
|
||||||
name: tor_detector_web
|
|
||||||
sha256: c4acbd6c0fecd2cd0e8fe00b1a37332422e041021a42488dfddcb3e7ec809b3f
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "1.1.0"
|
|
||||||
translations_cleaner:
|
translations_cleaner:
|
||||||
dependency: "direct dev"
|
dependency: "direct dev"
|
||||||
description:
|
description:
|
||||||
|
|
|
||||||
|
|
@ -76,7 +76,6 @@ dependencies:
|
||||||
sqflite_common_ffi: ^2.3.6
|
sqflite_common_ffi: ^2.3.6
|
||||||
sqlcipher_flutter_libs: ^0.6.8
|
sqlcipher_flutter_libs: ^0.6.8
|
||||||
swipe_to_action: ^0.3.0
|
swipe_to_action: ^0.3.0
|
||||||
tor_detector_web: ^1.1.0
|
|
||||||
unifiedpush: ^6.2.0
|
unifiedpush: ^6.2.0
|
||||||
unifiedpush_ui: ^0.2.0
|
unifiedpush_ui: ^0.2.0
|
||||||
universal_html: ^2.2.4
|
universal_html: ^2.2.4
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue