TF-4265 Add exclude list support to AttachmentTextDetector

This commit is contained in:
dab246
2026-01-30 13:16:17 +07:00
committed by Dat H. Pham
parent 772a5e3219
commit 1071bb49cf
7 changed files with 330 additions and 85 deletions
@@ -9,14 +9,15 @@ import 'package:tmail_ui_user/main/routes/route_navigation.dart';
extension AttachmentDetectionExtension on ComposerController {
List<String> validateAttachmentReminder({
Future<List<String>> validateAttachmentReminder({
required String emailContent,
required String emailSubject,
}) {
}) async {
try {
final fullContent = '$emailSubject $emailContent';
final plainText = HtmlUtils.extractPlainText(fullContent);
final keywords = AttachmentTextDetector.matchedKeywordsUnique(plainText);
final keywords =
await AttachmentTextDetector.matchedKeywordsUnique(plainText);
if (keywords.isEmpty) {
return [];
} else {