TF-1767 Fix Reply/Forward original message should be marked, not the sent one
(cherry picked from commit 827c6537cbad268dac4860fb0c57714811ed44e1)
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:jmap_dart_client/jmap/core/id.dart';
|
||||
import 'package:jmap_dart_client/jmap/identities/identity.dart';
|
||||
import 'package:jmap_dart_client/jmap/mail/email/email.dart';
|
||||
import 'package:jmap_dart_client/jmap/mail/mailbox/mailbox.dart';
|
||||
@@ -9,30 +8,33 @@ import 'package:model/email/email_action_type.dart';
|
||||
class EmailRequest with EquatableMixin {
|
||||
|
||||
final Email email;
|
||||
final Id submissionCreateId;
|
||||
final MailboxId? sentMailboxId;
|
||||
final EmailId? emailIdDestroyed;
|
||||
final EmailId? emailIdAnsweredOrForwarded;
|
||||
final Identity? identity;
|
||||
final EmailActionType? emailActionType;
|
||||
|
||||
EmailRequest(this.email, this.submissionCreateId, {
|
||||
EmailRequest(
|
||||
this.email, {
|
||||
this.sentMailboxId,
|
||||
this.identity,
|
||||
this.emailIdDestroyed,
|
||||
this.emailIdAnsweredOrForwarded,
|
||||
this.emailActionType
|
||||
});
|
||||
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
email,
|
||||
submissionCreateId,
|
||||
sentMailboxId,
|
||||
identity,
|
||||
emailIdDestroyed,
|
||||
emailIdAnsweredOrForwarded,
|
||||
emailActionType
|
||||
];
|
||||
|
||||
bool get isEmailAnswered => emailActionType == EmailActionType.reply || emailActionType == EmailActionType.replyAll;
|
||||
bool get isEmailAnswered => emailIdAnsweredOrForwarded != null &&
|
||||
(emailActionType == EmailActionType.reply || emailActionType == EmailActionType.replyAll);
|
||||
|
||||
bool get isEmailForwarded => emailActionType == EmailActionType.forward;
|
||||
bool get isEmailForwarded => emailIdAnsweredOrForwarded != null && emailActionType == EmailActionType.forward;
|
||||
}
|
||||
@@ -807,15 +807,14 @@ class ComposerController extends BaseController {
|
||||
|
||||
if (arguments != null && accountId != null && userProfile != null && session != null) {
|
||||
final email = await _generateEmail(context, userProfile, outboxMailboxId: outboxMailboxId);
|
||||
final submissionCreateId = Id(_uuid.v1());
|
||||
final emailRequest = EmailRequest(
|
||||
email,
|
||||
submissionCreateId,
|
||||
sentMailboxId: sentMailboxId,
|
||||
identity: identitySelected.value,
|
||||
emailIdDestroyed: arguments.emailActionType == EmailActionType.edit
|
||||
? arguments.presentationEmail?.id
|
||||
: null,
|
||||
emailIdAnsweredOrForwarded: arguments.presentationEmail?.id,
|
||||
emailActionType: arguments.emailActionType
|
||||
);
|
||||
final mailboxRequest = outboxMailboxId == null
|
||||
|
||||
Reference in New Issue
Block a user