TF-4404 Fix missing subject when perform Mail to attendees action in event email

This commit is contained in:
dab246
2026-03-25 10:30:50 +07:00
committed by Dat H. Pham
parent 93c96a2b83
commit 6a245f228a
7 changed files with 245 additions and 33 deletions
@@ -29,9 +29,34 @@ class EmailUtils {
static const double attachmentItemHeight = 36;
static const double attachmentIcon = 20;
static const int maxMobileVisibleAttachments = 3;
static const String defaultReplyPrefix = 'Re:';
static const String defaultForwardPrefix = 'Fwd:';
EmailUtils._();
static String applyPrefix({
required String subject,
required String defaultPrefix,
String? localizedPrefix,
}) {
final trimmed = subject.trim();
final lowerSubject = trimmed.toLowerCase();
final prefixes = <String>[
defaultPrefix.toLowerCase(),
if (localizedPrefix != null) localizedPrefix.toLowerCase(),
];
final hasPrefix = prefixes.any(lowerSubject.startsWith);
if (hasPrefix) {
return subject;
}
final prefix = localizedPrefix ?? defaultPrefix;
return '$prefix $subject';
}
static Properties getPropertiesForEmailGetMethod(Session session, AccountId accountId) {
if (CapabilityIdentifier.jamesCalendarEvent.isSupported(session, accountId)) {
return ThreadConstants.propertiesCalendarEvent;