TF-119 Filter messages with unread, attachments, starred
This commit is contained in:
@@ -90,6 +90,8 @@ class PresentationEmail with EquatableMixin {
|
||||
|
||||
bool isFlaggedEmail() => keywords?.containsKey(KeyWordIdentifier.emailFlagged) == true;
|
||||
|
||||
bool get withAttachments => hasAttachment == true;
|
||||
|
||||
String get mailboxName => mailboxNames?.first?.name ?? '';
|
||||
|
||||
@override
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
|
||||
import 'dart:ui';
|
||||
|
||||
import 'package:http_parser/http_parser.dart';
|
||||
import 'package:jmap_dart_client/jmap/core/properties/properties.dart';
|
||||
import 'package:jmap_dart_client/jmap/mail/email/email.dart';
|
||||
@@ -41,7 +43,7 @@ extension EmailExtension on Email {
|
||||
);
|
||||
}
|
||||
|
||||
PresentationEmail toPresentationEmail({SelectMode selectMode = SelectMode.INACTIVE}) {
|
||||
PresentationEmail toPresentationEmail({SelectMode selectMode = SelectMode.INACTIVE, List<Color>? avatarColors}) {
|
||||
return PresentationEmail(
|
||||
id,
|
||||
keywords: keywords,
|
||||
@@ -57,7 +59,8 @@ extension EmailExtension on Email {
|
||||
bcc: bcc,
|
||||
replyTo: replyTo,
|
||||
mailboxIds: mailboxIds,
|
||||
selectMode: selectMode
|
||||
selectMode: selectMode,
|
||||
avatarColors: avatarColors,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -111,7 +111,7 @@ extension PresentationEmailExtension on PresentationEmail {
|
||||
}
|
||||
}
|
||||
|
||||
PresentationEmail toSearchPresentationEmail(Map<MailboxId, PresentationMailbox> mapMailboxes) {
|
||||
PresentationEmail toSearchPresentationEmail(Map<MailboxId, PresentationMailbox> mapMailboxes, Random random) {
|
||||
mailboxIds?.removeWhere((key, value) => !value);
|
||||
|
||||
final listMailboxId = mailboxIds?.entries
|
||||
@@ -124,6 +124,8 @@ extension PresentationEmailExtension on PresentationEmail {
|
||||
.where((mailboxName) => mailboxName != null)
|
||||
.toList();
|
||||
|
||||
final newAvatarColors = AppColor.mapGradientColor[random.nextInt(AppColor.mapGradientColor.length)];
|
||||
|
||||
return PresentationEmail(
|
||||
this.id,
|
||||
keywords: keywords,
|
||||
@@ -141,7 +143,7 @@ extension PresentationEmailExtension on PresentationEmail {
|
||||
mailboxIds: mailboxIds,
|
||||
mailboxNames: listMailboxName,
|
||||
selectMode: selectMode,
|
||||
avatarColors: avatarColors
|
||||
avatarColors: avatarColors ?? newAvatarColors
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user