TF-79 Mark as star/unstar selected multiple email
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
|
||||
enum ImportantAction {
|
||||
enum MarkStarAction {
|
||||
markStar,
|
||||
unMarkStar
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
import 'package:jmap_dart_client/jmap/core/patch_object.dart';
|
||||
import 'package:jmap_dart_client/jmap/mail/email/keyword_identifier.dart';
|
||||
import 'package:model/email/important_action.dart';
|
||||
import 'package:model/email/mark_star_action.dart';
|
||||
import 'package:model/email/read_actions.dart';
|
||||
|
||||
extension KeyWordIdentifierExtension on KeyWordIdentifier {
|
||||
@@ -14,9 +14,9 @@ extension KeyWordIdentifierExtension on KeyWordIdentifier {
|
||||
});
|
||||
}
|
||||
|
||||
PatchObject generateImportantActionPath(ImportantAction importantAction) {
|
||||
PatchObject generateMarkStarActionPath(MarkStarAction markStarAction) {
|
||||
return PatchObject({
|
||||
_generatePath(): importantAction == ImportantAction.markStar ? true : null
|
||||
_generatePath(): markStarAction == MarkStarAction.markStar ? true : null
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -21,6 +21,10 @@ extension ListEmailIdExtension on List<EmailId> {
|
||||
final Map<Id, PatchObject> maps = {};
|
||||
forEach((emailId) {
|
||||
maps[emailId.id] = currentMailboxId.generateMoveToMailboxActionPath(destinationMailboxId);
|
||||
Map<Id, PatchObject> generateMapUpdateObjectMarkAsStar(MarkStarAction markStarAction) {
|
||||
final Map<Id, PatchObject> maps = {};
|
||||
forEach((emailId) {
|
||||
maps[emailId.id] = KeyWordIdentifier.emailFlagged.generateMarkStarActionPath(markStarAction);
|
||||
});
|
||||
return maps;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import 'package:core/core.dart';
|
||||
import 'package:jmap_dart_client/jmap/mail/email/email.dart';
|
||||
import 'package:jmap_dart_client/jmap/mail/email/keyword_identifier.dart';
|
||||
import 'package:jmap_dart_client/jmap/mail/email/email.dart';
|
||||
import 'package:model/model.dart';
|
||||
|
||||
extension PresentationEmailExtension on PresentationEmail {
|
||||
@@ -15,9 +17,11 @@ extension PresentationEmailExtension on PresentationEmail {
|
||||
}
|
||||
|
||||
PresentationEmail toggleSelect() {
|
||||
PresentationEmail toUpdatedPresentationEmail({Map<KeyWordIdentifier, bool>? newKeywords}) {
|
||||
return PresentationEmail(
|
||||
id,
|
||||
keywords: keywords,
|
||||
keywords: newKeywords ?? keywords,
|
||||
size: size,
|
||||
receivedAt: receivedAt,
|
||||
hasAttachment: hasAttachment,
|
||||
@@ -69,4 +73,22 @@ extension PresentationEmailExtension on PresentationEmail {
|
||||
replyTo: replyTo
|
||||
);
|
||||
}
|
||||
|
||||
Email toEmail() {
|
||||
return Email(
|
||||
id,
|
||||
keywords: keywords,
|
||||
size: size,
|
||||
receivedAt: receivedAt,
|
||||
hasAttachment: hasAttachment,
|
||||
preview: preview,
|
||||
subject: subject,
|
||||
sentAt: sentAt,
|
||||
from: from,
|
||||
to: to,
|
||||
cc: cc,
|
||||
bcc: bcc,
|
||||
replyTo: replyTo
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -26,6 +26,7 @@ export 'email/read_actions.dart';
|
||||
export 'email/attachment.dart';
|
||||
export 'email/move_action.dart';
|
||||
export 'email/important_action.dart';
|
||||
export 'email/mark_star_action.dart';
|
||||
|
||||
// Extensions
|
||||
export 'extensions/email_address_extension.dart';
|
||||
@@ -41,6 +42,7 @@ export 'extensions/email_body_part_extension.dart';
|
||||
export 'extensions/attachment_extension.dart';
|
||||
export 'extensions/list_email_id_extension.dart';
|
||||
export 'extensions/mailbox_id_extension.dart';
|
||||
export 'extensions/list_email_id_extension.dart';
|
||||
|
||||
// Download
|
||||
export 'download/download_task_id.dart';
|
||||
|
||||
Reference in New Issue
Block a user