TF-80 Move multiple email to mailbox from thread view

This commit is contained in:
dab246
2021-09-21 12:52:27 +07:00
committed by Dat H. Pham
parent 24e52dc6a4
commit a12efc8d2b
43 changed files with 1007 additions and 443 deletions
+25
View File
@@ -1,9 +1,16 @@
import 'package:jmap_dart_client/jmap/mail/email/email.dart';
import 'package:jmap_dart_client/jmap/mail/email/keyword_identifier.dart';
import 'package:model/model.dart';
extension EmailExtension on Email {
bool isUnReadEmail() => !(keywords?.containsKey(KeyWordIdentifier.emailSeen) == true);
bool isReadEmail() => keywords?.containsKey(KeyWordIdentifier.emailSeen) == true;
bool isFlaggedEmail() => keywords?.containsKey(KeyWordIdentifier.emailFlagged) == true;
Set<String> getRecipientEmailAddressList() {
final listEmailAddress = Set<String>();
final listToAddress = to.getListAddress() ?? [];
@@ -22,6 +29,24 @@ extension EmailExtension on Email {
);
}
Email updatedEmail({Map<KeyWordIdentifier, bool>? newKeywords}) {
return Email(
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
);
}
PresentationEmail toPresentationEmail({SelectMode selectMode = SelectMode.INACTIVE}) {
return PresentationEmail(
id,