fixed broken replyTo feature
This commit is contained in:
committed by
Dat H. Pham
parent
c35ea81c95
commit
b8b70d26d4
@@ -869,6 +869,7 @@ class ComposerController extends BaseController
|
||||
listToEmailAddress = List.from(recipients.value1);
|
||||
listCcEmailAddress = List.from(recipients.value2);
|
||||
listBccEmailAddress = List.from(recipients.value3);
|
||||
listReplyToEmailAddress = List.from(recipients.value4);
|
||||
|
||||
if (listToEmailAddress.isNotEmpty || listCcEmailAddress.isNotEmpty || listBccEmailAddress.isNotEmpty || listReplyToEmailAddress.isNotEmpty) {
|
||||
isInitialRecipient.value = true;
|
||||
|
||||
@@ -7,7 +7,7 @@ import 'package:model/extensions/list_email_address_extension.dart';
|
||||
import 'package:tmail_ui_user/features/email/presentation/utils/email_utils.dart';
|
||||
|
||||
extension PresentationEmailExtension on PresentationEmail {
|
||||
Tuple3<List<EmailAddress>, List<EmailAddress>, List<EmailAddress>> generateRecipientsEmailAddressForComposer({
|
||||
Tuple4<List<EmailAddress>, List<EmailAddress>, List<EmailAddress>, List<EmailAddress>> generateRecipientsEmailAddressForComposer({
|
||||
required EmailActionType emailActionType,
|
||||
bool isSender = false,
|
||||
String? userName,
|
||||
@@ -21,10 +21,17 @@ extension PresentationEmailExtension on PresentationEmail {
|
||||
|
||||
switch (emailActionType) {
|
||||
case EmailActionType.reply:
|
||||
final listReplyAddress = isSender ? newToAddress : newFromAddress;
|
||||
List<EmailAddress> listReplyAddress;
|
||||
if (newReplyToAddress.isNotEmpty) {
|
||||
listReplyAddress = newReplyToAddress;
|
||||
} else if (isSender) {
|
||||
listReplyAddress = newToAddress;
|
||||
} else {
|
||||
listReplyAddress = newFromAddress;
|
||||
}
|
||||
final listReplyAddressWithoutUsername = listReplyAddress.withoutMe(userName);
|
||||
|
||||
return Tuple3(listReplyAddressWithoutUsername, [], []);
|
||||
return Tuple4(listReplyAddressWithoutUsername, [], [], []);
|
||||
case EmailActionType.replyToList:
|
||||
final recipientRecord = EmailUtils.extractRecipientsFromListPost(listPost ?? '');
|
||||
|
||||
@@ -43,10 +50,11 @@ extension PresentationEmailExtension on PresentationEmail {
|
||||
.removeDuplicateEmails()
|
||||
.withoutMe(userName);
|
||||
|
||||
return Tuple3(
|
||||
return Tuple4(
|
||||
listToAddressWithoutUsername,
|
||||
listCcAddressWithoutUsername,
|
||||
listBccAddressWithoutUsername,
|
||||
[]
|
||||
);
|
||||
case EmailActionType.replyAll:
|
||||
final recipientRecord = EmailUtils.extractRecipientsFromListPost(listPost ?? '');
|
||||
@@ -71,20 +79,26 @@ extension PresentationEmailExtension on PresentationEmail {
|
||||
.removeDuplicateEmails()
|
||||
.withoutMe(userName);
|
||||
|
||||
return Tuple3(
|
||||
return Tuple4(
|
||||
listToAddressWithoutUsername,
|
||||
listCcAddressWithoutUsername,
|
||||
listBccAddressWithoutUsername,
|
||||
[]
|
||||
);
|
||||
|
||||
case EmailActionType.editDraft:
|
||||
return Tuple4(newToAddress, newCcAddress, newBccAddress, newReplyToAddress);
|
||||
|
||||
default:
|
||||
final listToAddressWithoutUsername = newToAddress.withoutMe(userName);
|
||||
final listCcAddressWithoutUsername = newCcAddress.withoutMe(userName);
|
||||
final listBccAddressWithoutUsername = newBccAddress.withoutMe(userName);
|
||||
|
||||
return Tuple3(
|
||||
return Tuple4(
|
||||
listToAddressWithoutUsername,
|
||||
listCcAddressWithoutUsername,
|
||||
listBccAddressWithoutUsername,
|
||||
[]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user