fluffychat merge

This commit is contained in:
ggurdin 2025-06-26 13:03:55 -04:00
commit 5b24baa7e5
No known key found for this signature in database
GPG key ID: A01CB41737CBB478
5 changed files with 40 additions and 18 deletions

View file

@ -1,3 +1,14 @@
## v2.0.0
This version migrates to Vodozemac and Matrix Dart SDK 1.0.0. This is a breaking
change. The user should not notice the migration at all but downgrading from
v2.0.0 to a previous version is not possible without losing the session.
- build: Switch to matrix sdk 1.0.0 (Christian Kußowski)
- build: Upgrade flutter to 3.32.2 (krille-chan)
- chore: Add missing mounted check (Christian Kußowski)
- refactor: sdk 1.0 (Christian Kußowski)
## v1.27.0
- feat: Add confirmation dialog before accepting invite (krille-chan)
- feat: Add feature flag for refresh tokens (Christian Kußowski)

View file

@ -59,7 +59,9 @@ abstract class AppRoutes {
GoRouterState state,
) {
// #Pangea
// Matrix.of(context).client.isLogged() ? '/rooms' : null;
// Matrix.of(context).widget.clients.any((client) => client.isLogged())
// ? '/rooms'
// : null;
return PAuthGaurd.loggedInRedirect(context, state);
// Pangea#
}
@ -69,7 +71,9 @@ abstract class AppRoutes {
GoRouterState state,
) {
// #Pangea
// Matrix.of(context).client.isLogged() ? null : '/home';
// Matrix.of(context).widget.clients.any((client) => client.isLogged())
// ? null
// : '/home';
return PAuthGaurd.loggedOutRedirect(context, state);
// Pangea#
}
@ -80,7 +84,9 @@ abstract class AppRoutes {
GoRoute(
path: '/',
redirect: (context, state) =>
Matrix.of(context).client.isLogged() ? '/rooms' : '/home',
Matrix.of(context).widget.clients.any((client) => client.isLogged())
? '/rooms'
: '/home',
),
GoRoute(
path: '/home',

View file

@ -25,7 +25,8 @@ class HomeserverPickerView extends StatelessWidget {
final theme = Theme.of(context);
return LoginScaffold(
enforceMobileMode: Matrix.of(context).client.isLogged(),
enforceMobileMode:
Matrix.of(context).widget.clients.any((client) => client.isLogged()),
appBar: AppBar(
centerTitle: true,
title: Text(

View file

@ -21,7 +21,8 @@ class LoginView extends StatelessWidget {
final titleParts = title.split(homeserver);
return LoginScaffold(
enforceMobileMode: Matrix.of(context).client.isLogged(),
enforceMobileMode:
Matrix.of(context).widget.clients.any((client) => client.isLogged()),
appBar: AppBar(
leading:
controller.loadingSignIn ? null : const Center(child: BackButton()),

View file

@ -30,12 +30,12 @@ import 'package:fluffychat/utils/voip_plugin.dart';
import 'package:fluffychat/widgets/adaptive_dialogs/show_ok_cancel_alert_dialog.dart';
import 'package:fluffychat/widgets/fluffy_chat_app.dart';
import 'package:fluffychat/widgets/future_loading_dialog.dart';
import 'package:fluffychat/widgets/local_notifications_extension.dart';
import '../config/app_config.dart';
import '../config/setting_keys.dart';
import '../pages/key_verification/key_verification_dialog.dart';
import '../utils/account_bundles.dart';
import '../utils/background_push.dart';
import 'local_notifications_extension.dart';
// import 'package:flutter_secure_storage/flutter_secure_storage.dart';
@ -192,6 +192,7 @@ class MatrixState extends State<Matrix> with WidgetsBindingObserver {
// #Pangea
candidate.homeserver = Uri.parse("https://${AppConfig.defaultHomeserver}");
// Pangea#
if (widget.clients.isEmpty) widget.clients.add(candidate);
return candidate;
}
@ -312,15 +313,15 @@ class MatrixState extends State<Matrix> with WidgetsBindingObserver {
onLoginStateChanged[name] ??=
c.onLoginStateChanged.stream.listen((state) async {
final loggedInWithMultipleClients = widget.clients.length > 1;
// #Pangea
// if (state == LoginState.loggedOut) {
// InitWithRestoreExtension.deleteSessionBackup(name);
// }
// Pangea#
if (loggedInWithMultipleClients && state != LoginState.loggedIn) {
if (state == LoginState.loggedOut) {
_cancelSubs(c.clientName);
widget.clients.remove(c);
ClientManager.removeClientNameFromStore(c.clientName, store);
// #Pangea
// InitWithRestoreExtension.deleteSessionBackup(name);
// Pangea#
}
if (loggedInWithMultipleClients && state != LoginState.loggedIn) {
ScaffoldMessenger.of(
FluffyChatApp.router.routerDelegate.navigatorKey.currentContext ??
context,
@ -431,12 +432,14 @@ class MatrixState extends State<Matrix> with WidgetsBindingObserver {
Logs().v('AppLifecycleState = $state');
final foreground = state != AppLifecycleState.inactive &&
state != AppLifecycleState.paused;
client.syncPresence =
state == AppLifecycleState.resumed ? null : PresenceType.unavailable;
if (PlatformInfos.isMobile) {
client.backgroundSync = foreground;
client.requestHistoryOnLimitedTimeline = !foreground;
Logs().v('Set background sync to', foreground);
for (final client in widget.clients) {
client.syncPresence =
state == AppLifecycleState.resumed ? null : PresenceType.unavailable;
if (PlatformInfos.isMobile) {
client.backgroundSync = foreground;
client.requestHistoryOnLimitedTimeline = !foreground;
Logs().v('Set background sync to', foreground);
}
}
}