feat: implement session dump
Signed-off-by: TheOneWithTheBraid <the-one@with-the-braid.cf>
This commit is contained in:
parent
ec74524234
commit
56ba2341f4
10 changed files with 203 additions and 5 deletions
|
|
@ -1,6 +1,7 @@
|
|||
import 'dart:async';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:adaptive_dialog/adaptive_dialog.dart';
|
||||
|
|
@ -23,6 +24,10 @@ import '../../utils/matrix_sdk_extensions.dart/matrix_file_extension.dart';
|
|||
import '../../utils/url_launcher.dart';
|
||||
import '../../widgets/matrix.dart';
|
||||
import '../bootstrap/bootstrap_dialog.dart';
|
||||
import '../settings_account/settings_account.dart';
|
||||
|
||||
import 'package:fluffychat/utils/tor_stub.dart'
|
||||
if (dart.library.html) 'package:tor_detector_web/tor_detector_web.dart';
|
||||
|
||||
enum SelectMode { normal, share, select }
|
||||
|
||||
|
|
@ -143,6 +148,8 @@ class ChatListController extends State<ChatList> with TickerProviderStateMixin {
|
|||
isSearching = false;
|
||||
});
|
||||
|
||||
bool isTorBrowser = false;
|
||||
|
||||
SpacesEntry get activeSpacesEntry {
|
||||
final id = _activeSpacesEntry;
|
||||
return (id == null || !id.stillValid(context)) ? defaultSpacesEntry : id;
|
||||
|
|
@ -300,6 +307,9 @@ class ChatListController extends State<ChatList> with TickerProviderStateMixin {
|
|||
WidgetsBinding.instance.addPostFrameCallback((_) async {
|
||||
searchServer = await Store().getItem(_serverStoreNamespace);
|
||||
});
|
||||
|
||||
_checkTorBrowser();
|
||||
|
||||
super.initState();
|
||||
}
|
||||
|
||||
|
|
@ -652,6 +662,15 @@ class ChatListController extends State<ChatList> with TickerProviderStateMixin {
|
|||
void _hackyWebRTCFixForWeb() {
|
||||
Matrix.of(context).voipPlugin?.context = context;
|
||||
}
|
||||
|
||||
Future<void> _checkTorBrowser() async {
|
||||
if (!kIsWeb) return;
|
||||
final isTor = await TorBrowserDetector.isTorBrowser;
|
||||
setState(() => isTorBrowser = isTor);
|
||||
}
|
||||
|
||||
Future<void> dehydrate() =>
|
||||
SettingsAccountController.dehydrateDevice(context);
|
||||
}
|
||||
|
||||
enum EditBundleAction { addToBundle, removeFromBundle }
|
||||
|
|
|
|||
|
|
@ -204,6 +204,23 @@ class _ChatListViewBodyState extends State<ChatListViewBody> {
|
|||
),
|
||||
),
|
||||
),
|
||||
AnimatedContainer(
|
||||
height: widget.controller.isTorBrowser ? 64 : 0,
|
||||
duration: const Duration(milliseconds: 300),
|
||||
clipBehavior: Clip.hardEdge,
|
||||
curve: Curves.bounceInOut,
|
||||
decoration: const BoxDecoration(),
|
||||
child: Material(
|
||||
color: Theme.of(context).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: widget.controller.dehydrate,
|
||||
),
|
||||
),
|
||||
),
|
||||
if (widget.controller.isSearchMode)
|
||||
_SearchTitle(
|
||||
title: L10n.of(context)!.chats,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue