TF-3221 Handle mailto with additional cc and bcc

This commit is contained in:
DatDang
2024-10-25 11:28:59 +07:00
committed by Dat H. Pham
parent 51a4a1b9b7
commit 45581e4177
9 changed files with 292 additions and 59 deletions
@@ -629,6 +629,16 @@ class ComposerController extends BaseController
isInitialRecipient.value = true;
toAddressExpandMode.value = ExpandMode.COLLAPSE;
}
if (arguments.cc?.isNotEmpty == true) {
listCcEmailAddress = arguments.cc!;
ccRecipientState.value = PrefixRecipientState.enabled;
ccAddressExpandMode.value = ExpandMode.COLLAPSE;
}
if (arguments.bcc?.isNotEmpty == true) {
bccRecipientState.value = PrefixRecipientState.enabled;
bccAddressExpandMode.value = ExpandMode.COLLAPSE;
listBccEmailAddress = arguments.bcc!;
}
_getEmailContentFromMailtoUri(arguments.body ?? '');
_updateStatusEmailSendButton();
break;
@@ -1729,10 +1739,15 @@ class ComposerController extends BaseController
if (bccRecipientState.value == PrefixRecipientState.disabled) {
bccRecipientState.value = PrefixRecipientState.enabled;
}
listBccEmailAddress = listEmailAddress.toList();
if (composerArguments.value?.emailActionType == EmailActionType.composeFromMailtoUri) {
listBccEmailAddress = {...listEmailAddress, ...?composerArguments.value?.bcc}.toList();
} else {
listBccEmailAddress = listEmailAddress.toList();
}
toAddressExpandMode.value = ExpandMode.COLLAPSE;
ccAddressExpandMode.value = ExpandMode.COLLAPSE;
bccAddressExpandMode.value = ExpandMode.COLLAPSE;
bccAddressExpandMode.refresh();
_updateStatusEmailSendButton();
}