opt pm msg

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-07-08 18:52:07 +08:00
parent d2023b1750
commit 8bf55ec95a
2 changed files with 50 additions and 56 deletions

View File

@@ -266,10 +266,12 @@ class _ReplyPageState extends CommonRichTextPubPageState<ReplyPage> {
@override @override
Future<void> onCustomPublish({List? pictures}) async { Future<void> onCustomPublish({List? pictures}) async {
Map<String, int> atNameToMid = { Map<String, int> atNameToMid = {};
for (var e in editController.items) for (var e in editController.items) {
if (e.type == RichTextType.at) e.rawText: int.parse(e.id!), if (e.type == RichTextType.at) {
}; atNameToMid[e.rawText] ??= int.parse(e.id!);
}
}
String message = editController.rawText; String message = editController.rawText;
var result = await VideoHttp.replyAdd( var result = await VideoHttp.replyAdd(
type: widget.replyType, type: widget.replyType,

View File

@@ -617,26 +617,20 @@ class ChatItem extends StatelessWidget {
required dynamic content, required dynamic content,
required Color textColor, required Color textColor,
}) { }) {
late final style = TextStyle( final style = TextStyle(color: textColor, letterSpacing: 0.6, height: 1.5);
color: textColor,
letterSpacing: 0.6,
height: 1.5,
);
if (eInfos != null) {
final List<InlineSpan> children = []; final List<InlineSpan> children = [];
Map<String, Map> emojiMap = {}; late final Map<String, Map> emojiMap = {};
final List<String> patterns = [Constants.urlRegex.pattern];
if (eInfos != null) {
for (var e in eInfos!) { for (var e in eInfos!) {
emojiMap[e.text] = { emojiMap[e.text] ??= {
'url': e.hasGifUrl() ? e.gifUrl : e.url, 'url': e.hasGifUrl() ? e.gifUrl : e.url,
'size': e.size * 24.0, 'size': e.size * 22.0,
}; };
} }
final regex = RegExp( patterns.addAll(emojiMap.keys.map(RegExp.escape));
[ }
...emojiMap.keys.map(RegExp.escape), final regex = RegExp(patterns.join('|'));
Constants.urlRegex.pattern,
].join('|'),
);
content['content'].splitMapJoin( content['content'].splitMapJoin(
regex, regex,
onMatch: (Match match) { onMatch: (Match match) {
@@ -677,8 +671,6 @@ class ChatItem extends StatelessWidget {
); );
return SelectableText.rich(TextSpan(children: children)); return SelectableText.rich(TextSpan(children: children));
} }
return SelectableText(content['content'], style: style);
}
Widget msgTypeNotifyMsg_10(ThemeData theme, content) { Widget msgTypeNotifyMsg_10(ThemeData theme, content) {
List? modules = content['modules'] as List?; List? modules = content['modules'] as List?;