mirror of
				https://gitlab.com/famedly/fluffychat.git
				synced 2025-11-04 06:17:26 +01:00 
			
		
		
		
	Merge branch 'krille/minor-fixes' into 'main'
Krille/minor fixes See merge request famedly/fluffychat!571
This commit is contained in:
		
						commit
						f6699bf87f
					
				@ -43,6 +43,7 @@ abstract class AppConfig {
 | 
			
		||||
  static const bool hideTypingUsernames = false;
 | 
			
		||||
  static const bool hideAllStateEvents = false;
 | 
			
		||||
  static const String inviteLinkPrefix = 'https://matrix.to/#/';
 | 
			
		||||
  static const String deepLinkPrefix = 'im.fluffychat://chat/';
 | 
			
		||||
  static const String schemePrefix = 'matrix:';
 | 
			
		||||
  static const String pushNotificationsChannelId = 'fluffychat_push';
 | 
			
		||||
  static const String pushNotificationsChannelName = 'FluffyChat push channel';
 | 
			
		||||
 | 
			
		||||
@ -135,7 +135,7 @@ abstract class FluffyThemes {
 | 
			
		||||
              primary: FluffyThemes.lighten(AppConfig.chatColor, 0.33),
 | 
			
		||||
              secondary: FluffyThemes.lighten(AppConfig.chatColor, 0.33),
 | 
			
		||||
              secondaryVariant: AppConfig.secondaryColor,
 | 
			
		||||
              surface: FluffyThemes.darken(AppConfig.chatColor, 0.4),
 | 
			
		||||
              surface: FluffyThemes.darken(AppConfig.chatColor, 0.35),
 | 
			
		||||
            ),
 | 
			
		||||
        secondaryHeaderColor: Colors.blueGrey.shade900,
 | 
			
		||||
        textTheme: Typography.material2018().white.merge(fallbackTextTheme),
 | 
			
		||||
 | 
			
		||||
@ -83,7 +83,10 @@ class ChatView extends StatelessWidget {
 | 
			
		||||
                  child: Row(
 | 
			
		||||
                    mainAxisSize: MainAxisSize.min,
 | 
			
		||||
                    children: [
 | 
			
		||||
                      const Icon(Icons.report_outlined),
 | 
			
		||||
                      const Icon(
 | 
			
		||||
                        Icons.shield_outlined,
 | 
			
		||||
                        color: Colors.red,
 | 
			
		||||
                      ),
 | 
			
		||||
                      const SizedBox(width: 12),
 | 
			
		||||
                      Text(L10n.of(context).reportMessage),
 | 
			
		||||
                    ],
 | 
			
		||||
@ -331,7 +334,7 @@ class ChatView extends StatelessWidget {
 | 
			
		||||
                            .secondaryHeaderColor
 | 
			
		||||
                            .withAlpha(100),
 | 
			
		||||
                        clipBehavior: Clip.hardEdge,
 | 
			
		||||
                        color: Theme.of(context).backgroundColor,
 | 
			
		||||
                        color: Theme.of(context).appBarTheme.backgroundColor,
 | 
			
		||||
                        child: SafeArea(
 | 
			
		||||
                          child: Column(
 | 
			
		||||
                            mainAxisSize: MainAxisSize.min,
 | 
			
		||||
 | 
			
		||||
@ -5,6 +5,7 @@ import 'package:flutter/material.dart';
 | 
			
		||||
import 'package:flutter_gen/gen_l10n/l10n.dart';
 | 
			
		||||
import 'package:matrix/matrix.dart';
 | 
			
		||||
 | 
			
		||||
import 'package:fluffychat/config/app_config.dart';
 | 
			
		||||
import 'package:fluffychat/utils/date_time_extension.dart';
 | 
			
		||||
import 'package:fluffychat/widgets/avatar.dart';
 | 
			
		||||
 | 
			
		||||
@ -27,7 +28,7 @@ class EventInfoDialog extends StatelessWidget {
 | 
			
		||||
 | 
			
		||||
  String get prettyJson {
 | 
			
		||||
    const JsonDecoder decoder = JsonDecoder();
 | 
			
		||||
    const JsonEncoder encoder = JsonEncoder.withIndent('  ');
 | 
			
		||||
    const JsonEncoder encoder = JsonEncoder.withIndent('    ');
 | 
			
		||||
    final object = decoder.convert(jsonEncode(event.toJson()));
 | 
			
		||||
    return encoder.convert(object);
 | 
			
		||||
  }
 | 
			
		||||
@ -52,7 +53,7 @@ class EventInfoDialog extends StatelessWidget {
 | 
			
		||||
            ),
 | 
			
		||||
            title: Text(L10n.of(context).sender),
 | 
			
		||||
            subtitle:
 | 
			
		||||
                Text('${event.sender.calcDisplayname()} <${event.senderId}>'),
 | 
			
		||||
                Text('${event.sender.calcDisplayname()} [${event.senderId}]'),
 | 
			
		||||
          ),
 | 
			
		||||
          ListTile(
 | 
			
		||||
            title: Text(L10n.of(context).time),
 | 
			
		||||
@ -62,14 +63,17 @@ class EventInfoDialog extends StatelessWidget {
 | 
			
		||||
            title: Text(L10n.of(context).messageType),
 | 
			
		||||
            subtitle: Text(event.humanreadableType),
 | 
			
		||||
          ),
 | 
			
		||||
          ListTile(
 | 
			
		||||
            title: Text(L10n.of(context).sourceCode),
 | 
			
		||||
          ),
 | 
			
		||||
          ListTile(title: Text('${L10n.of(context).sourceCode}:')),
 | 
			
		||||
          Padding(
 | 
			
		||||
            padding: const EdgeInsets.all(12.0),
 | 
			
		||||
            child: SingleChildScrollView(
 | 
			
		||||
              scrollDirection: Axis.horizontal,
 | 
			
		||||
              child: Text(prettyJson),
 | 
			
		||||
            child: Material(
 | 
			
		||||
              borderRadius: BorderRadius.circular(AppConfig.borderRadius),
 | 
			
		||||
              color: Theme.of(context).colorScheme.surface,
 | 
			
		||||
              child: SingleChildScrollView(
 | 
			
		||||
                padding: const EdgeInsets.all(8),
 | 
			
		||||
                scrollDirection: Axis.horizontal,
 | 
			
		||||
                child: SelectableText(prettyJson),
 | 
			
		||||
              ),
 | 
			
		||||
            ),
 | 
			
		||||
          ),
 | 
			
		||||
        ],
 | 
			
		||||
 | 
			
		||||
@ -220,22 +220,25 @@ class Message extends StatelessWidget {
 | 
			
		||||
                            ),
 | 
			
		||||
                            if (event.hasAggregatedEvents(
 | 
			
		||||
                                timeline, RelationshipTypes.edit))
 | 
			
		||||
                              Row(
 | 
			
		||||
                                mainAxisSize: MainAxisSize.min,
 | 
			
		||||
                                children: [
 | 
			
		||||
                                  Icon(
 | 
			
		||||
                                    Icons.edit_outlined,
 | 
			
		||||
                                    color: textColor.withAlpha(164),
 | 
			
		||||
                                    size: 14,
 | 
			
		||||
                                  ),
 | 
			
		||||
                                  Text(
 | 
			
		||||
                                    ' - ${displayEvent.originServerTs.localizedTimeShort(context)}',
 | 
			
		||||
                                    style: TextStyle(
 | 
			
		||||
                              Padding(
 | 
			
		||||
                                padding: const EdgeInsets.only(top: 4.0),
 | 
			
		||||
                                child: Row(
 | 
			
		||||
                                  mainAxisSize: MainAxisSize.min,
 | 
			
		||||
                                  children: [
 | 
			
		||||
                                    Icon(
 | 
			
		||||
                                      Icons.edit_outlined,
 | 
			
		||||
                                      color: textColor.withAlpha(164),
 | 
			
		||||
                                      fontSize: 12,
 | 
			
		||||
                                      size: 14,
 | 
			
		||||
                                    ),
 | 
			
		||||
                                  ),
 | 
			
		||||
                                ],
 | 
			
		||||
                                    Text(
 | 
			
		||||
                                      ' - ${displayEvent.originServerTs.localizedTimeShort(context)}',
 | 
			
		||||
                                      style: TextStyle(
 | 
			
		||||
                                        color: textColor.withAlpha(164),
 | 
			
		||||
                                        fontSize: 12,
 | 
			
		||||
                                      ),
 | 
			
		||||
                                    ),
 | 
			
		||||
                                  ],
 | 
			
		||||
                                ),
 | 
			
		||||
                              ),
 | 
			
		||||
                          ],
 | 
			
		||||
                        ),
 | 
			
		||||
 | 
			
		||||
@ -20,7 +20,8 @@ class UrlLauncher {
 | 
			
		||||
  const UrlLauncher(this.context, this.url);
 | 
			
		||||
 | 
			
		||||
  void launchUrl() {
 | 
			
		||||
    if (url.toLowerCase().startsWith(AppConfig.inviteLinkPrefix) ||
 | 
			
		||||
    if (url.toLowerCase().startsWith(AppConfig.deepLinkPrefix) ||
 | 
			
		||||
        url.toLowerCase().startsWith(AppConfig.inviteLinkPrefix) ||
 | 
			
		||||
        {'#', '@', '!', '+', '\$'}.contains(url[0]) ||
 | 
			
		||||
        url.toLowerCase().startsWith(AppConfig.schemePrefix)) {
 | 
			
		||||
      return openMatrixToUrl();
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user