TF-1857 Add headerCalendarEvent to email cached

(cherry picked from commit 6d884bb6db5365c6308404fb5d98fd356be4109e)
This commit is contained in:
dab246
2023-07-19 17:08:01 +07:00
committed by Dat Vu
parent c37ab20901
commit 7df56f3f66
6 changed files with 42 additions and 18 deletions
+21 -18
View File
@@ -4,6 +4,7 @@ import 'dart:convert';
import 'package:jmap_dart_client/jmap/core/properties/properties.dart';
import 'package:jmap_dart_client/jmap/mail/email/email.dart';
import 'package:jmap_dart_client/jmap/mail/email/email_body_part.dart';
import 'package:jmap_dart_client/jmap/mail/email/individual_header_identifier.dart';
import 'package:jmap_dart_client/jmap/mail/email/keyword_identifier.dart';
import 'package:jmap_dart_client/jmap/mail/mailbox/mailbox.dart';
import 'package:model/model.dart';
@@ -38,24 +39,25 @@ extension EmailExtension on Email {
Email updatedEmail({Map<KeyWordIdentifier, bool>? newKeywords, Map<MailboxId, bool>? newMailboxIds}) {
return Email(
id: id,
keywords: newKeywords ?? keywords,
size: size,
receivedAt: receivedAt,
hasAttachment: hasAttachment,
preview: preview,
subject: subject,
sentAt: sentAt,
from: from,
to: to,
cc: cc,
bcc: bcc,
replyTo: replyTo,
mailboxIds: newMailboxIds ?? mailboxIds,
htmlBody: htmlBody,
bodyValues: bodyValues,
headerUserAgent: headerUserAgent,
attachments: attachments
id: id,
keywords: newKeywords ?? keywords,
size: size,
receivedAt: receivedAt,
hasAttachment: hasAttachment,
preview: preview,
subject: subject,
sentAt: sentAt,
from: from,
to: to,
cc: cc,
bcc: bcc,
replyTo: replyTo,
mailboxIds: newMailboxIds ?? mailboxIds,
htmlBody: htmlBody,
bodyValues: bodyValues,
headerUserAgent: headerUserAgent,
attachments: attachments,
headerCalendarEvent: headerCalendarEvent
);
}
@@ -97,6 +99,7 @@ extension EmailExtension on Email {
bcc: updatedProperties.contain(EmailProperty.bcc) ? newEmail.bcc : bcc,
replyTo: updatedProperties.contain(EmailProperty.replyTo) ? newEmail.replyTo : replyTo,
mailboxIds: updatedProperties.contain(EmailProperty.mailboxIds) ? newEmail.mailboxIds : mailboxIds,
headerCalendarEvent: updatedProperties.contain(IndividualHeaderIdentifier.headerCalendarEvent.value) ? newEmail.headerCalendarEvent : headerCalendarEvent,
);
}
@@ -97,6 +97,9 @@ extension PresentationEmailExtension on PresentationEmail {
replyTo: replyTo,
htmlBody: htmlBody,
bodyValues: bodyValues,
mailboxIds: mailboxIds,
headers: emailHeader?.toSet(),
headerCalendarEvent: headerCalendarEvent
);
}