Merge pull request #2681 from krille-chan/krille/small-adjustments

refactor: Disable custom image resizer for macOS and windows
This commit is contained in:
Krille-chan 2026-03-10 10:58:34 +01:00 committed by GitHub
commit 57044f01d8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 65 additions and 23 deletions

View file

@ -39,3 +39,6 @@ labels: test
10. Drag&Drop to send a file into a chat still works:
- [ ] Web
- [ ] Linux
11. Deeplinks are still working? https://matrix.to/#/@krille:janian.de
- [ ] Android
- [ ] iOS

View file

@ -65,7 +65,8 @@ enum AppSettings<T> {
'chat.fluffy.privacy_policy_url',
'https://fluffychat.im/en/privacy',
),
tos<String>('chat.fluffy.tos_url', 'https://fluffychat.im/en/tos');
tos<String>('chat.fluffy.tos_url', 'https://fluffychat.im/en/tos'),
sendTimelineEventTimeout<int>('chat.fluffy.send_timeline_event_timeout', 15);
final String key;
final T defaultValue;

View file

@ -74,7 +74,7 @@ abstract class FluffyThemes {
),
inputDecorationTheme: InputDecorationTheme(
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(AppConfig.borderRadius),
borderRadius: BorderRadius.circular(AppConfig.borderRadius / 2),
),
contentPadding: const EdgeInsets.all(12),
),

View file

@ -191,10 +191,9 @@ class _InviteContactListTile extends StatelessWidget {
overflow: TextOverflow.ellipsis,
style: TextStyle(color: theme.colorScheme.secondary),
),
trailing: TextButton.icon(
trailing: TextButton(
onPressed: isMember ? null : onTap,
label: Text(isMember ? l10n.participant : l10n.invite),
icon: Icon(isMember ? Icons.check : Icons.add),
child: Text(isMember ? l10n.participant : l10n.invite),
),
);
}

View file

@ -123,7 +123,9 @@ abstract class ClientManager {
// To make room emotes work
'im.ponies.room_emotes',
},
customImageResizer: customImageResizer,
customImageResizer: PlatformInfos.supportsCustomImageResizer
? customImageResizer
: null,
logLevel: kReleaseMode ? Level.warning : Level.verbose,
database: await flutterMatrixSdkDatabaseBuilder(clientName),
supportedLoginTypes: {
@ -141,6 +143,9 @@ abstract class ClientManager {
onSoftLogout: enableSoftLogout
? (client) => client.refreshAccessToken()
: null,
sendTimelineEventTimeout: Duration(
seconds: AppSettings.sendTimelineEventTimeout.value,
),
);
}

View file

@ -33,6 +33,9 @@ abstract class PlatformInfos {
static bool get supportsVideoPlayer =>
!PlatformInfos.isWindows && !PlatformInfos.isLinux;
static bool get supportsCustomImageResizer =>
PlatformInfos.isWeb || PlatformInfos.isMobile;
/// Web could also record in theory but currently only wav which is too large
static bool get platformCanRecord => (isMobile || isMacOS || isWeb);

View file

@ -52,7 +52,7 @@ Future<void> connectToHomeserverFlow(
if (authMetadata != null && AppSettings.enableMatrixNativeOIDC.value) {
await oidcLoginFlow(client, context, signUp);
} else if (supportsSso) {
await ssoLoginFlow(client, context, signUp);
await ssoLoginFlow(client, context, signUp, loginFlows);
} else {
if (signUp && regLink != null) {
await launchUrlString(regLink);

View file

@ -3,20 +3,52 @@ import 'package:flutter/material.dart';
import 'package:flutter_web_auth_2/flutter_web_auth_2.dart';
import 'package:matrix/matrix.dart';
import 'package:fluffychat/l10n/l10n.dart';
import 'package:fluffychat/utils/platform_infos.dart';
import 'package:fluffychat/utils/sign_in_flows/calc_redirect_url.dart';
import 'package:fluffychat/widgets/adaptive_dialogs/show_modal_action_popup.dart';
Future<void> ssoLoginFlow(
Client client,
BuildContext context,
bool signUp,
List<LoginFlow> loginFlows,
) async {
final (redirectUrl, urlScheme) = calcRedirectUrl(withAuthHtmlPath: true);
Logs().i('Starting legacy SSO Flow with redirect URL', redirectUrl);
final ssoProviders =
(loginFlows
.firstWhere((flow) => flow.type == 'm.login.sso')
.additionalProperties['identity_providers']
as List?)
?.map(
(json) => (
name: json['name'] as String,
id: json['id'] as String,
brand: json['brand'] as String?,
icon: json['icon'] as String?,
),
)
.toList();
final provider = ssoProviders == null
? null
: await showModalActionPopup(
context: context,
title: L10n.of(context).logInTo(client.homeserver!.host),
actions: ssoProviders
.map(
(provider) =>
AdaptiveModalAction(label: provider.name, value: provider),
)
.toList(),
);
final url = client.homeserver!.replace(
path: '/_matrix/client/v3/login/sso/redirect',
path:
'/_matrix/client/v3/login/sso/redirect${provider == null ? '' : '/${provider.id}'}',
queryParameters: {
'redirectUrl': redirectUrl.toString(),
'action': signUp ? 'register' : 'login',

View file

@ -108,7 +108,9 @@ class AdaptiveDialogInkWell extends StatelessWidget {
);
}
return Material(
color: theme.colorScheme.surfaceBright,
color: onTap == null
? theme.colorScheme.surfaceContainer
: theme.colorScheme.surfaceBright,
borderRadius: BorderRadius.circular(AppConfig.borderRadius / 2),
child: InkWell(
borderRadius: BorderRadius.circular(AppConfig.borderRadius / 2),

View file

@ -185,6 +185,7 @@ class PublicRoomDialog extends StatelessWidget {
style: theme.textTheme.bodyMedium
?.copyWith(fontSize: 10),
),
maxLines: 1,
textAlign: TextAlign.center,
),
),

View file

@ -20,7 +20,7 @@ Future<int?> showPermissionChooser(
child: Column(
mainAxisSize: .min,
crossAxisAlignment: .stretch,
spacing: 12.0,
spacing: 16.0,
children: [
Text(L10n.of(context).setPowerLevelDescription),
ValueListenableBuilder(

View file

@ -91,7 +91,11 @@ class QrCodeViewer extends StatelessWidget {
margin: const EdgeInsets.all(32.0),
padding: const EdgeInsets.all(32.0),
decoration: BoxDecoration(
color: theme.colorScheme.primaryContainer,
border: Border.all(
color: theme.colorScheme.onPrimaryContainer,
width: 4,
),
color: theme.colorScheme.surfaceBright,
borderRadius: BorderRadius.circular(AppConfig.borderRadius),
),
child: Column(

View file

@ -10,16 +10,6 @@
"English"
]
},
{
"name": "converser.eu",
"website": "https://converser.eu",
"description": "A free and decentralized communication server.",
"reg_method": "oidc",
"languages": [
"All",
"Français"
]
},
{
"name": "mozilla.org",
"website": "https://mozilla.org",
@ -31,11 +21,13 @@
]
},
{
"name": "magdeburg.jetzt",
"website": "https://magdeburg.jetzt",
"name": "tchncs.de",
"website": "https://tchncs.de",
"description": "A general homeserver. Owner also hosts other FOSS services.",
"reg_method": "oidc",
"languages": [
"All",
"English",
"Deutsch"
]
}