Re-add mention functionality

pull/1384/head
Kelrap 1 year ago committed by ggurdin
parent b57326628c
commit 9d0bf230e1
No known key found for this signature in database
GPG Key ID: A01CB41737CBB478

@ -63,13 +63,11 @@ abstract class AppConfig {
path: '/krille-chan/fluffychat/issues/new', path: '/krille-chan/fluffychat/issues/new',
); );
// #Pangea // #Pangea
// static bool renderHtml = true;
static const bool enableSentry = true; static const bool enableSentry = true;
static const String sentryDns = static const String sentryDns =
'https://8591d0d863b646feb4f3dda7e5dcab38@o256755.ingest.sentry.io/5243143'; 'https://8591d0d863b646feb4f3dda7e5dcab38@o256755.ingest.sentry.io/5243143';
static bool renderHtml = false;
// static bool renderHtml = true;
// Pangea# // Pangea#
static bool renderHtml = true;
static bool hideRedactedEvents = false; static bool hideRedactedEvents = false;
static bool hideUnknownEvents = true; static bool hideUnknownEvents = true;
static bool hideUnimportantStateEvents = true; static bool hideUnimportantStateEvents = true;

@ -1,9 +1,13 @@
import 'package:emojis/emoji.dart'; import 'package:emojis/emoji.dart';
import 'package:fluffychat/config/app_config.dart'; import 'package:fluffychat/config/app_config.dart';
import 'package:fluffychat/pages/chat/command_hints.dart';
import 'package:fluffychat/pangea/widgets/igc/pangea_text_controller.dart'; import 'package:fluffychat/pangea/widgets/igc/pangea_text_controller.dart';
import 'package:fluffychat/utils/platform_infos.dart'; import 'package:fluffychat/utils/platform_infos.dart';
import 'package:fluffychat/widgets/avatar.dart';
import 'package:fluffychat/widgets/mxc_image.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter_gen/gen_l10n/l10n.dart';
import 'package:flutter_typeahead/flutter_typeahead.dart'; import 'package:flutter_typeahead/flutter_typeahead.dart';
import 'package:matrix/matrix.dart'; import 'package:matrix/matrix.dart';
import 'package:pasteboard/pasteboard.dart'; import 'package:pasteboard/pasteboard.dart';
@ -217,6 +221,7 @@ class InputBar extends StatelessWidget {
} }
} }
} }
print("ret length: ${ret.length}");
return ret; return ret;
} }
@ -225,106 +230,104 @@ class InputBar extends StatelessWidget {
Map<String, String?> suggestion, Map<String, String?> suggestion,
Client? client, Client? client,
) { ) {
// #Pangea const size = 30.0;
// const size = 30.0; const padding = EdgeInsets.all(4.0);
// const padding = EdgeInsets.all(4.0); if (suggestion['type'] == 'command') {
// if (suggestion['type'] == 'command') { final command = suggestion['name']!;
// final command = suggestion['name']!; final hint = commandHint(L10n.of(context)!, command);
// final hint = commandHint(L10n.of(context)!, command); return Tooltip(
// return Tooltip( message: hint,
// message: hint, waitDuration: const Duration(days: 1), // don't show on hover
// waitDuration: const Duration(days: 1), // don't show on hover child: Container(
// child: Container( padding: padding,
// padding: padding, child: Column(
// child: Column( crossAxisAlignment: CrossAxisAlignment.start,
// crossAxisAlignment: CrossAxisAlignment.start, children: [
// children: [ Text(
// Text( commandExample(command),
// commandExample(command), style: const TextStyle(fontFamily: 'monospace'),
// style: const TextStyle(fontFamily: 'monospace'), ),
// ), Text(
// Text( hint,
// hint, maxLines: 1,
// maxLines: 1, overflow: TextOverflow.ellipsis,
// overflow: TextOverflow.ellipsis, style: Theme.of(context).textTheme.bodySmall,
// style: Theme.of(context).textTheme.bodySmall, ),
// ), ],
// ], ),
// ), ),
// ), );
// ); }
// } if (suggestion['type'] == 'emoji') {
// if (suggestion['type'] == 'emoji') { final label = suggestion['label']!;
// final label = suggestion['label']!; return Tooltip(
// return Tooltip( message: label,
// message: label, waitDuration: const Duration(days: 1), // don't show on hover
// waitDuration: const Duration(days: 1), // don't show on hover child: Container(
// child: Container( padding: padding,
// padding: padding, child: Text(label, style: const TextStyle(fontFamily: 'monospace')),
// child: Text(label, style: const TextStyle(fontFamily: 'monospace')), ),
// ), );
// ); }
// } if (suggestion['type'] == 'emote') {
// if (suggestion['type'] == 'emote') { return Container(
// return Container( padding: padding,
// padding: padding, child: Row(
// child: Row( crossAxisAlignment: CrossAxisAlignment.center,
// crossAxisAlignment: CrossAxisAlignment.center, children: <Widget>[
// children: <Widget>[ MxcImage(
// MxcImage( // ensure proper ordering ...
// // ensure proper ordering ... key: ValueKey(suggestion['name']),
// key: ValueKey(suggestion['name']), uri: suggestion['mxc'] is String
// uri: suggestion['mxc'] is String ? Uri.parse(suggestion['mxc'] ?? '')
// ? Uri.parse(suggestion['mxc'] ?? '') : null,
// : null, width: size,
// width: size, height: size,
// height: size, ),
// ), const SizedBox(width: 6),
// const SizedBox(width: 6), Text(suggestion['name']!),
// Text(suggestion['name']!), Expanded(
// Expanded( child: Align(
// child: Align( alignment: Alignment.centerRight,
// alignment: Alignment.centerRight, child: Opacity(
// child: Opacity( opacity: suggestion['pack_avatar_url'] != null ? 0.8 : 0.5,
// opacity: suggestion['pack_avatar_url'] != null ? 0.8 : 0.5, child: suggestion['pack_avatar_url'] != null
// child: suggestion['pack_avatar_url'] != null ? Avatar(
// ? Avatar( mxContent: Uri.tryParse(
// mxContent: Uri.tryParse( suggestion.tryGet<String>('pack_avatar_url') ?? '',
// suggestion.tryGet<String>('pack_avatar_url') ?? '', ),
// ), name: suggestion.tryGet<String>('pack_display_name'),
// name: suggestion.tryGet<String>('pack_display_name'), size: size * 0.9,
// size: size * 0.9, client: client,
// client: client, )
// ) : Text(suggestion['pack_display_name']!),
// : Text(suggestion['pack_display_name']!), ),
// ), ),
// ), ),
// ), ],
// ], ),
// ), );
// ); }
// } if (suggestion['type'] == 'user' || suggestion['type'] == 'room') {
// if (suggestion['type'] == 'user' || suggestion['type'] == 'room') { final url = Uri.parse(suggestion['avatar_url'] ?? '');
// final url = Uri.parse(suggestion['avatar_url'] ?? ''); return Container(
// return Container( padding: padding,
// padding: padding, child: Row(
// child: Row( crossAxisAlignment: CrossAxisAlignment.center,
// crossAxisAlignment: CrossAxisAlignment.center, children: <Widget>[
// children: <Widget>[ Avatar(
// Avatar( mxContent: url,
// mxContent: url, name: suggestion.tryGet<String>('displayname') ??
// name: suggestion.tryGet<String>('displayname') ?? suggestion.tryGet<String>('mxid'),
// suggestion.tryGet<String>('mxid'), size: size,
// size: size, client: client,
// client: client, ),
// ), const SizedBox(width: 6),
// const SizedBox(width: 6), Text(suggestion['displayname'] ?? suggestion['mxid']!),
// Text(suggestion['displayname'] ?? suggestion['mxid']!), ],
// ], ),
// ), );
// ); }
// }
// Pangea#
return const SizedBox.shrink(); return const SizedBox.shrink();
} }

Loading…
Cancel
Save