Skip to content

Commit 8ddcc18

Browse files
dab246hoangdat
authored andcommittedMar 7, 2025
TF-3449 Set priority headers in email object when send or save draft email
Signed-off-by: dab246 <tdvu@linagora.com>
1 parent 621756d commit 8ddcc18

File tree

12 files changed

+60
-17
lines changed

12 files changed

+60
-17
lines changed
 

‎contact/pubspec.lock

+2-2
Original file line numberDiff line numberDiff line change
@@ -660,10 +660,10 @@ packages:
660660
description:
661661
path: "."
662662
ref: main
663-
resolved-ref: "278183b54ccfcda7396273c556609d28194e34f1"
663+
resolved-ref: "00b8c073e9e8b6f1caa831c400a5c31e56424c08"
664664
url: "https://github.com/linagora/jmap-dart-client.git"
665665
source: git
666-
version: "0.3.2"
666+
version: "0.3.3"
667667
js:
668668
dependency: transitive
669669
description:

‎email_recovery/pubspec.lock

+2-2
Original file line numberDiff line numberDiff line change
@@ -296,10 +296,10 @@ packages:
296296
description:
297297
path: "."
298298
ref: main
299-
resolved-ref: "278183b54ccfcda7396273c556609d28194e34f1"
299+
resolved-ref: "00b8c073e9e8b6f1caa831c400a5c31e56424c08"
300300
url: "https://github.com/linagora/jmap-dart-client.git"
301301
source: git
302-
version: "0.3.2"
302+
version: "0.3.3"
303303
js:
304304
dependency: transitive
305305
description:

‎fcm/pubspec.lock

+2-2
Original file line numberDiff line numberDiff line change
@@ -296,10 +296,10 @@ packages:
296296
description:
297297
path: "."
298298
ref: main
299-
resolved-ref: "278183b54ccfcda7396273c556609d28194e34f1"
299+
resolved-ref: "00b8c073e9e8b6f1caa831c400a5c31e56424c08"
300300
url: "https://github.com/linagora/jmap-dart-client.git"
301301
source: git
302-
version: "0.3.2"
302+
version: "0.3.3"
303303
js:
304304
dependency: transitive
305305
description:

‎forward/pubspec.lock

+2-2
Original file line numberDiff line numberDiff line change
@@ -296,10 +296,10 @@ packages:
296296
description:
297297
path: "."
298298
ref: main
299-
resolved-ref: "278183b54ccfcda7396273c556609d28194e34f1"
299+
resolved-ref: "00b8c073e9e8b6f1caa831c400a5c31e56424c08"
300300
url: "https://github.com/linagora/jmap-dart-client.git"
301301
source: git
302-
version: "0.3.2"
302+
version: "0.3.3"
303303
js:
304304
dependency: transitive
305305
description:

‎lib/features/composer/presentation/composer_controller.dart

+3
Original file line numberDiff line numberDiff line change
@@ -496,6 +496,7 @@ class ComposerController extends BaseController
496496
bccRecipients: listBccEmailAddress.toSet(),
497497
replyToRecipients: listReplyToEmailAddress.toSet(),
498498
hasRequestReadReceipt: hasRequestReadReceipt.value,
499+
isMarkAsImportant: isMarkAsImportant.value,
499500
identity: identitySelected.value,
500501
attachments: uploadController.attachmentsUploaded,
501502
inlineAttachments: uploadController.mapInlineAttachments,
@@ -1092,6 +1093,7 @@ class ComposerController extends BaseController
10921093
bccRecipients: listBccEmailAddress.toSet(),
10931094
replyToRecipients: listReplyToEmailAddress.toSet(),
10941095
hasRequestReadReceipt: hasRequestReadReceipt.value,
1096+
isMarkAsImportant: isMarkAsImportant.value,
10951097
identity: identitySelected.value,
10961098
attachments: uploadController.attachmentsUploaded,
10971099
inlineAttachments: uploadController.mapInlineAttachments,
@@ -2358,6 +2360,7 @@ class ComposerController extends BaseController
23582360
bccRecipients: listBccEmailAddress.toSet(),
23592361
replyToRecipients: listReplyToEmailAddress.toSet(),
23602362
hasRequestReadReceipt: hasRequestReadReceipt.value,
2363+
isMarkAsImportant: isMarkAsImportant.value,
23612364
identity: identitySelected.value,
23622365
attachments: uploadController.attachmentsUploaded,
23632366
inlineAttachments: uploadController.mapInlineAttachments,

‎lib/features/composer/presentation/extensions/create_email_request_extension.dart

+11-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import 'package:model/mailbox/presentation_mailbox.dart';
1414
import 'package:tmail_ui_user/features/composer/domain/model/email_request.dart';
1515
import 'package:tmail_ui_user/features/composer/presentation/extensions/identity_extension.dart';
1616
import 'package:tmail_ui_user/features/composer/presentation/model/create_email_request.dart';
17+
import 'package:tmail_ui_user/features/composer/presentation/model/mail_priority_header.dart';
1718
import 'package:tmail_ui_user/features/email/domain/extensions/list_attachments_extension.dart';
1819
import 'package:tmail_ui_user/features/mailbox/domain/model/create_new_mailbox_request.dart';
1920
import 'package:tmail_ui_user/features/sending_queue/domain/extensions/sending_email_extension.dart';
@@ -156,7 +157,16 @@ extension CreateEmailRequestExtension on CreateEmailRequest {
156157
: null,
157158
identityHeader: withIdentityHeader
158159
? {IndividualHeaderIdentifier.identityHeader: identity?.id?.id.value}
159-
: null
160+
: null,
161+
xPriorityHeader: isMarkAsImportant
162+
? {IndividualHeaderIdentifier.xPriorityHeader: MailPriorityHeader.asImportant().xPriority}
163+
: null,
164+
importanceHeader: isMarkAsImportant
165+
? {IndividualHeaderIdentifier.importanceHeader: MailPriorityHeader.asImportant().importance}
166+
: null,
167+
priorityHeader: isMarkAsImportant
168+
? {IndividualHeaderIdentifier.priorityHeader: MailPriorityHeader.asImportant().priority}
169+
: null,
160170
);
161171
}
162172

‎lib/features/composer/presentation/model/create_email_request.dart

+3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ class CreateEmailRequest with EquatableMixin {
1919
final String subject;
2020
final String emailContent;
2121
final bool hasRequestReadReceipt;
22+
final bool isMarkAsImportant;
2223
final Set<EmailAddress>? fromSender;
2324
final Set<EmailAddress>? toRecipients;
2425
final Set<EmailAddress>? ccRecipients;
@@ -50,6 +51,7 @@ class CreateEmailRequest with EquatableMixin {
5051
this.bccRecipients,
5152
this.replyToRecipients,
5253
this.hasRequestReadReceipt = true,
54+
this.isMarkAsImportant = false,
5355
this.identity,
5456
this.attachments,
5557
this.inlineAttachments,
@@ -79,6 +81,7 @@ class CreateEmailRequest with EquatableMixin {
7981
replyToRecipients,
8082
identity,
8183
hasRequestReadReceipt,
84+
isMarkAsImportant,
8285
attachments,
8386
inlineAttachments,
8487
outboxMailboxId,
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
2+
import 'package:equatable/equatable.dart';
3+
4+
class MailPriorityHeader with EquatableMixin {
5+
final String? xPriority;
6+
final String? importance;
7+
final String? priority;
8+
9+
MailPriorityHeader({
10+
this.xPriority,
11+
this.importance,
12+
this.priority,
13+
});
14+
15+
factory MailPriorityHeader.asImportant() => MailPriorityHeader(
16+
xPriority: '1',
17+
importance: 'high',
18+
priority: 'urgent',
19+
);
20+
21+
@override
22+
List<Object?> get props => [
23+
xPriority,
24+
importance,
25+
priority,
26+
];
27+
}

‎model/pubspec.lock

+2-2
Original file line numberDiff line numberDiff line change
@@ -652,10 +652,10 @@ packages:
652652
description:
653653
path: "."
654654
ref: main
655-
resolved-ref: "278183b54ccfcda7396273c556609d28194e34f1"
655+
resolved-ref: "00b8c073e9e8b6f1caa831c400a5c31e56424c08"
656656
url: "https://github.com/linagora/jmap-dart-client.git"
657657
source: git
658-
version: "0.3.2"
658+
version: "0.3.3"
659659
js:
660660
dependency: transitive
661661
description:

‎pubspec.lock

+2-2
Original file line numberDiff line numberDiff line change
@@ -1332,10 +1332,10 @@ packages:
13321332
description:
13331333
path: "."
13341334
ref: main
1335-
resolved-ref: "278183b54ccfcda7396273c556609d28194e34f1"
1335+
resolved-ref: "00b8c073e9e8b6f1caa831c400a5c31e56424c08"
13361336
url: "https://github.com/linagora/jmap-dart-client.git"
13371337
source: git
1338-
version: "0.3.2"
1338+
version: "0.3.3"
13391339
js:
13401340
dependency: transitive
13411341
description:

‎rule_filter/pubspec.lock

+2-2
Original file line numberDiff line numberDiff line change
@@ -296,10 +296,10 @@ packages:
296296
description:
297297
path: "."
298298
ref: main
299-
resolved-ref: "278183b54ccfcda7396273c556609d28194e34f1"
299+
resolved-ref: "00b8c073e9e8b6f1caa831c400a5c31e56424c08"
300300
url: "https://github.com/linagora/jmap-dart-client.git"
301301
source: git
302-
version: "0.3.2"
302+
version: "0.3.3"
303303
js:
304304
dependency: transitive
305305
description:

‎server_settings/pubspec.lock

+2-2
Original file line numberDiff line numberDiff line change
@@ -288,10 +288,10 @@ packages:
288288
description:
289289
path: "."
290290
ref: main
291-
resolved-ref: "278183b54ccfcda7396273c556609d28194e34f1"
291+
resolved-ref: "00b8c073e9e8b6f1caa831c400a5c31e56424c08"
292292
url: "https://github.com/linagora/jmap-dart-client.git"
293293
source: git
294-
version: "0.3.2"
294+
version: "0.3.3"
295295
js:
296296
dependency: transitive
297297
description:

0 commit comments

Comments
 (0)
Please sign in to comment.