Handle the behaviour of Reply email when user is sender

Signed-off-by: dab246 <tdvu@linagora.com>
This commit is contained in:
dab246
2025-02-19 15:52:00 +07:00
committed by Dat H. Pham
parent bcad1e0cd9
commit 8d6bbccc56
2 changed files with 34 additions and 9 deletions
@@ -32,11 +32,21 @@ extension PresentationEmailExtension on PresentationEmail {
cc.numberEmailAddress() +
bcc.numberEmailAddress();
int getCountMailAddressWithoutMe(String userName) =>
to.withoutMe(userName).numberEmailAddress() +
cc.withoutMe(userName).numberEmailAddress() +
bcc.withoutMe(userName).numberEmailAddress() +
from.withoutMe(userName).numberEmailAddress();
int getCountMailAddressWithoutMe(String userName) {
final uniqueEmails = <String>{};
final newTo = to ?? {};
final newCc = cc ?? {};
final newBcc = bcc ?? {};
final newFrom = from ?? {};
for (final email in <EmailAddress>[...newTo, ...newCc, ...newBcc, ...newFrom]) {
if (email.emailAddress != userName) {
uniqueEmails.add(email.emailAddress);
}
}
return uniqueEmails.length;
}
String getReceivedAt(String newLocale, {String? pattern}) {
final emailTime = receivedAt;