Merge pull request #2681 from krille-chan/krille/small-adjustments
refactor: Disable custom image resizer for macOS and windows
This commit is contained in:
commit
57044f01d8
13 changed files with 65 additions and 23 deletions
3
.github/ISSUE_TEMPLATE/test_report.md
vendored
3
.github/ISSUE_TEMPLATE/test_report.md
vendored
|
|
@ -39,3 +39,6 @@ labels: test
|
||||||
10. Drag&Drop to send a file into a chat still works:
|
10. Drag&Drop to send a file into a chat still works:
|
||||||
- [ ] Web
|
- [ ] Web
|
||||||
- [ ] Linux
|
- [ ] Linux
|
||||||
|
11. Deeplinks are still working? https://matrix.to/#/@krille:janian.de
|
||||||
|
- [ ] Android
|
||||||
|
- [ ] iOS
|
||||||
|
|
@ -65,7 +65,8 @@ enum AppSettings<T> {
|
||||||
'chat.fluffy.privacy_policy_url',
|
'chat.fluffy.privacy_policy_url',
|
||||||
'https://fluffychat.im/en/privacy',
|
'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 String key;
|
||||||
final T defaultValue;
|
final T defaultValue;
|
||||||
|
|
|
||||||
|
|
@ -74,7 +74,7 @@ abstract class FluffyThemes {
|
||||||
),
|
),
|
||||||
inputDecorationTheme: InputDecorationTheme(
|
inputDecorationTheme: InputDecorationTheme(
|
||||||
border: OutlineInputBorder(
|
border: OutlineInputBorder(
|
||||||
borderRadius: BorderRadius.circular(AppConfig.borderRadius),
|
borderRadius: BorderRadius.circular(AppConfig.borderRadius / 2),
|
||||||
),
|
),
|
||||||
contentPadding: const EdgeInsets.all(12),
|
contentPadding: const EdgeInsets.all(12),
|
||||||
),
|
),
|
||||||
|
|
|
||||||
|
|
@ -191,10 +191,9 @@ class _InviteContactListTile extends StatelessWidget {
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
style: TextStyle(color: theme.colorScheme.secondary),
|
style: TextStyle(color: theme.colorScheme.secondary),
|
||||||
),
|
),
|
||||||
trailing: TextButton.icon(
|
trailing: TextButton(
|
||||||
onPressed: isMember ? null : onTap,
|
onPressed: isMember ? null : onTap,
|
||||||
label: Text(isMember ? l10n.participant : l10n.invite),
|
child: Text(isMember ? l10n.participant : l10n.invite),
|
||||||
icon: Icon(isMember ? Icons.check : Icons.add),
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -123,7 +123,9 @@ abstract class ClientManager {
|
||||||
// To make room emotes work
|
// To make room emotes work
|
||||||
'im.ponies.room_emotes',
|
'im.ponies.room_emotes',
|
||||||
},
|
},
|
||||||
customImageResizer: customImageResizer,
|
customImageResizer: PlatformInfos.supportsCustomImageResizer
|
||||||
|
? customImageResizer
|
||||||
|
: null,
|
||||||
logLevel: kReleaseMode ? Level.warning : Level.verbose,
|
logLevel: kReleaseMode ? Level.warning : Level.verbose,
|
||||||
database: await flutterMatrixSdkDatabaseBuilder(clientName),
|
database: await flutterMatrixSdkDatabaseBuilder(clientName),
|
||||||
supportedLoginTypes: {
|
supportedLoginTypes: {
|
||||||
|
|
@ -141,6 +143,9 @@ abstract class ClientManager {
|
||||||
onSoftLogout: enableSoftLogout
|
onSoftLogout: enableSoftLogout
|
||||||
? (client) => client.refreshAccessToken()
|
? (client) => client.refreshAccessToken()
|
||||||
: null,
|
: null,
|
||||||
|
sendTimelineEventTimeout: Duration(
|
||||||
|
seconds: AppSettings.sendTimelineEventTimeout.value,
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,9 @@ abstract class PlatformInfos {
|
||||||
static bool get supportsVideoPlayer =>
|
static bool get supportsVideoPlayer =>
|
||||||
!PlatformInfos.isWindows && !PlatformInfos.isLinux;
|
!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
|
/// Web could also record in theory but currently only wav which is too large
|
||||||
static bool get platformCanRecord => (isMobile || isMacOS || isWeb);
|
static bool get platformCanRecord => (isMobile || isMacOS || isWeb);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ Future<void> connectToHomeserverFlow(
|
||||||
if (authMetadata != null && AppSettings.enableMatrixNativeOIDC.value) {
|
if (authMetadata != null && AppSettings.enableMatrixNativeOIDC.value) {
|
||||||
await oidcLoginFlow(client, context, signUp);
|
await oidcLoginFlow(client, context, signUp);
|
||||||
} else if (supportsSso) {
|
} else if (supportsSso) {
|
||||||
await ssoLoginFlow(client, context, signUp);
|
await ssoLoginFlow(client, context, signUp, loginFlows);
|
||||||
} else {
|
} else {
|
||||||
if (signUp && regLink != null) {
|
if (signUp && regLink != null) {
|
||||||
await launchUrlString(regLink);
|
await launchUrlString(regLink);
|
||||||
|
|
|
||||||
|
|
@ -3,20 +3,52 @@ import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_web_auth_2/flutter_web_auth_2.dart';
|
import 'package:flutter_web_auth_2/flutter_web_auth_2.dart';
|
||||||
import 'package:matrix/matrix.dart';
|
import 'package:matrix/matrix.dart';
|
||||||
|
|
||||||
|
import 'package:fluffychat/l10n/l10n.dart';
|
||||||
import 'package:fluffychat/utils/platform_infos.dart';
|
import 'package:fluffychat/utils/platform_infos.dart';
|
||||||
import 'package:fluffychat/utils/sign_in_flows/calc_redirect_url.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(
|
Future<void> ssoLoginFlow(
|
||||||
Client client,
|
Client client,
|
||||||
BuildContext context,
|
BuildContext context,
|
||||||
bool signUp,
|
bool signUp,
|
||||||
|
List<LoginFlow> loginFlows,
|
||||||
) async {
|
) async {
|
||||||
final (redirectUrl, urlScheme) = calcRedirectUrl(withAuthHtmlPath: true);
|
final (redirectUrl, urlScheme) = calcRedirectUrl(withAuthHtmlPath: true);
|
||||||
|
|
||||||
Logs().i('Starting legacy SSO Flow with redirect URL', redirectUrl);
|
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(
|
final url = client.homeserver!.replace(
|
||||||
path: '/_matrix/client/v3/login/sso/redirect',
|
path:
|
||||||
|
'/_matrix/client/v3/login/sso/redirect${provider == null ? '' : '/${provider.id}'}',
|
||||||
queryParameters: {
|
queryParameters: {
|
||||||
'redirectUrl': redirectUrl.toString(),
|
'redirectUrl': redirectUrl.toString(),
|
||||||
'action': signUp ? 'register' : 'login',
|
'action': signUp ? 'register' : 'login',
|
||||||
|
|
|
||||||
|
|
@ -108,7 +108,9 @@ class AdaptiveDialogInkWell extends StatelessWidget {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return Material(
|
return Material(
|
||||||
color: theme.colorScheme.surfaceBright,
|
color: onTap == null
|
||||||
|
? theme.colorScheme.surfaceContainer
|
||||||
|
: theme.colorScheme.surfaceBright,
|
||||||
borderRadius: BorderRadius.circular(AppConfig.borderRadius / 2),
|
borderRadius: BorderRadius.circular(AppConfig.borderRadius / 2),
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
borderRadius: BorderRadius.circular(AppConfig.borderRadius / 2),
|
borderRadius: BorderRadius.circular(AppConfig.borderRadius / 2),
|
||||||
|
|
|
||||||
|
|
@ -185,6 +185,7 @@ class PublicRoomDialog extends StatelessWidget {
|
||||||
style: theme.textTheme.bodyMedium
|
style: theme.textTheme.bodyMedium
|
||||||
?.copyWith(fontSize: 10),
|
?.copyWith(fontSize: 10),
|
||||||
),
|
),
|
||||||
|
maxLines: 1,
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ Future<int?> showPermissionChooser(
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: .min,
|
mainAxisSize: .min,
|
||||||
crossAxisAlignment: .stretch,
|
crossAxisAlignment: .stretch,
|
||||||
spacing: 12.0,
|
spacing: 16.0,
|
||||||
children: [
|
children: [
|
||||||
Text(L10n.of(context).setPowerLevelDescription),
|
Text(L10n.of(context).setPowerLevelDescription),
|
||||||
ValueListenableBuilder(
|
ValueListenableBuilder(
|
||||||
|
|
|
||||||
|
|
@ -91,7 +91,11 @@ class QrCodeViewer extends StatelessWidget {
|
||||||
margin: const EdgeInsets.all(32.0),
|
margin: const EdgeInsets.all(32.0),
|
||||||
padding: const EdgeInsets.all(32.0),
|
padding: const EdgeInsets.all(32.0),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: theme.colorScheme.primaryContainer,
|
border: Border.all(
|
||||||
|
color: theme.colorScheme.onPrimaryContainer,
|
||||||
|
width: 4,
|
||||||
|
),
|
||||||
|
color: theme.colorScheme.surfaceBright,
|
||||||
borderRadius: BorderRadius.circular(AppConfig.borderRadius),
|
borderRadius: BorderRadius.circular(AppConfig.borderRadius),
|
||||||
),
|
),
|
||||||
child: Column(
|
child: Column(
|
||||||
|
|
|
||||||
|
|
@ -10,16 +10,6 @@
|
||||||
"English"
|
"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",
|
"name": "mozilla.org",
|
||||||
"website": "https://mozilla.org",
|
"website": "https://mozilla.org",
|
||||||
|
|
@ -31,11 +21,13 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "magdeburg.jetzt",
|
"name": "tchncs.de",
|
||||||
"website": "https://magdeburg.jetzt",
|
"website": "https://tchncs.de",
|
||||||
|
"description": "A general homeserver. Owner also hosts other FOSS services.",
|
||||||
"reg_method": "oidc",
|
"reg_method": "oidc",
|
||||||
"languages": [
|
"languages": [
|
||||||
"All",
|
"All",
|
||||||
|
"English",
|
||||||
"Deutsch"
|
"Deutsch"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue