b3ce1f076c
TF-3881 Thread Detail Unsubscribe context menu TF-3881 Thread Detail Update date time format TF-3881 Thread Detail Update sender receiver spacing TF-3881 Thread Detail Add messageId and references to presentation email TF-3881 Thread Detail Filter created email on refresh TF-3881 Thread Detail Fix CI TF-3881 Thread Detail Fix previous action throws out of index TF-3881 Thread Detail Update sender receiver spacing TF-3881 Thread Detail Adjust email actions when expanded TF-3881 Thread Detail Adjust days ago received time TF-3881 Thread Detail Fix debouncer when update setting TF-3881 Thread Detail Adjust days ago received time TF-3881 Thread Detail Adjust email actions when expanded TF-3881 Thread Detail Hide next previous if not in range TF-3881 Thread Detail Arrange more action according to text direction TF-3881 Thread Detail Hide next previous if not in range TF-3881 Thread Detail Fix move email on tablet
44 lines
2.0 KiB
Dart
44 lines
2.0 KiB
Dart
import 'package:jmap_dart_client/jmap/mail/email/email.dart';
|
|
import 'package:jmap_dart_client/jmap/mail/mailbox/mailbox.dart';
|
|
import 'package:tmail_ui_user/features/thread/data/extensions/map_header_identifier_id_extension.dart';
|
|
import 'package:tmail_ui_user/features/thread/data/model/email_cache.dart';
|
|
import 'package:tmail_ui_user/features/thread/data/extensions/map_keywords_extension.dart';
|
|
import 'package:tmail_ui_user/features/thread/data/extensions/email_address_extension.dart';
|
|
import 'package:tmail_ui_user/features/thread/data/extensions/map_mailbox_id_extension.dart';
|
|
|
|
extension EmailExtension on Email {
|
|
|
|
EmailCache toEmailCache() {
|
|
return EmailCache(
|
|
id!.id.value,
|
|
keywords: keywords?.toMapString(),
|
|
size: size?.value.round(),
|
|
receivedAt: receivedAt?.value,
|
|
hasAttachment: hasAttachment,
|
|
preview: preview,
|
|
subject: subject,
|
|
sentAt: sentAt?.value,
|
|
from: from?.map((emailAddress) => emailAddress.toEmailAddressHiveCache()).toList(),
|
|
to: to?.map((emailAddress) => emailAddress.toEmailAddressHiveCache()).toList(),
|
|
cc: cc?.map((emailAddress) => emailAddress.toEmailAddressHiveCache()).toList(),
|
|
bcc: bcc?.map((emailAddress) => emailAddress.toEmailAddressHiveCache()).toList(),
|
|
replyTo: replyTo?.map((emailAddress) => emailAddress.toEmailAddressHiveCache()).toList(),
|
|
mailboxIds: mailboxIds?.toMapString(),
|
|
threadId: threadId?.id.value,
|
|
headerCalendarEvent: headerCalendarEvent?.toMapString(),
|
|
blobId: blobId?.value,
|
|
xPriorityHeader: xPriorityHeader?.toMapString(),
|
|
importanceHeader: importanceHeader?.toMapString(),
|
|
priorityHeader: priorityHeader?.toMapString(),
|
|
unsubscribeHeader: listUnsubscribeHeader?.toMapString(),
|
|
messageId: messageId?.ids.toList(),
|
|
references: references?.ids.toList(),
|
|
);
|
|
}
|
|
|
|
bool belongTo(MailboxId mailboxId) {
|
|
return mailboxIds != null
|
|
&& mailboxIds!.containsKey(mailboxId)
|
|
&& mailboxIds![mailboxId] == true;
|
|
}
|
|
} |