TF-1961 Transform html email content in composer

(cherry picked from commit f5470c130744242195b265a0ea4aad044ad8e740)
This commit is contained in:
dab246
2023-08-18 19:42:04 +07:00
committed by Dat Vu
parent e06d35f1e1
commit 8eed49fd73
45 changed files with 1139 additions and 644 deletions
@@ -19,6 +19,8 @@ extension EmailExtension on Email {
bool get hasMdnSent => keywords?.containsKey(KeyWordIdentifier.mdnSent) == true;
bool get isDraft => keywords?.containsKey(KeyWordIdentifier.emailDraft) == true;
bool get withAttachments => hasAttachment == true;
bool hasReadReceipt(Map<MailboxId, PresentationMailbox> mapMailbox) {
@@ -127,6 +129,13 @@ extension EmailExtension on Email {
return [];
}
List<Attachment> get attachmentsWithCid {
return attachments
?.where((element) => element.disposition != null && element.cid?.isNotEmpty == true)
.map((item) => item.toAttachment())
.toList() ?? [];
}
PresentationMailbox? findMailboxContain(Map<MailboxId, PresentationMailbox> mapMailbox) {
final newMailboxIds = mailboxIds;
newMailboxIds?.removeWhere((key, value) => !value);