TF-3189 new option to enable/disable subaddressing for a personal folder

This commit is contained in:
Florent Azavant
2024-10-21 16:29:26 +02:00
committed by Dat H. Pham
parent f8f248fc3c
commit 89d80fe142
36 changed files with 455 additions and 4 deletions
@@ -34,6 +34,7 @@ extension MailboxExtension on Mailbox {
myRights: myRights,
isSubscribed: isSubscribed,
namespace: namespace,
rights: rights
);
}
@@ -51,6 +52,7 @@ extension MailboxExtension on Mailbox {
myRights: updatedProperties.contain(MailboxProperty.myRights) ? newMailbox.myRights : myRights,
isSubscribed: updatedProperties.contain(MailboxProperty.isSubscribed) ? newMailbox.isSubscribed : isSubscribed,
namespace: updatedProperties.contain(MailboxProperty.namespace) ? newMailbox.namespace : namespace,
rights: updatedProperties.contain(MailboxProperty.rights) ? newMailbox.rights : rights,
);
}
@@ -68,6 +70,7 @@ extension MailboxExtension on Mailbox {
myRights: myRights,
isSubscribed: isSubscribed,
namespace: namespace,
rights: rights
);
}
@@ -2,6 +2,7 @@ import 'package:jmap_dart_client/jmap/mail/mailbox/mailbox.dart';
import 'package:jmap_dart_client/jmap/mail/mailbox/namespace.dart';
import 'package:model/mailbox/mailbox_state.dart';
import 'package:model/mailbox/presentation_mailbox.dart';
import 'package:model/mailbox/mailbox_constants.dart';
import 'package:model/mailbox/select_mode.dart';
extension PresentationMailboxExtension on PresentationMailbox {
@@ -49,6 +50,8 @@ extension PresentationMailboxExtension on PresentationMailbox {
bool get isSubscribedMailbox => isSubscribed != null && isSubscribed?.value == true;
bool get isSubaddressingAllowed => rights != null && rights?[anyoneIdentifier]?.contains(postingRight) == true;
bool get allowedToDisplayCountOfUnreadEmails => !(isTrash || isSpam || isDrafts || isTemplates || isSent) && countUnreadEmails > 0;
bool get allowedToDisplayCountOfTotalEmails => (isTrash || isSpam || isDrafts) && countTotalEmails > 0;
@@ -100,6 +103,7 @@ extension PresentationMailboxExtension on PresentationMailbox {
state: state,
namespace: namespace,
displayName: displayName,
rights: rights
);
}
@@ -121,6 +125,7 @@ extension PresentationMailboxExtension on PresentationMailbox {
state: state,
namespace: namespace,
displayName: displayName,
rights: rights
);
}
@@ -142,6 +147,7 @@ extension PresentationMailboxExtension on PresentationMailbox {
state: newMailboxState,
namespace: namespace,
displayName: displayName,
rights: rights
);
}
@@ -159,6 +165,7 @@ extension PresentationMailboxExtension on PresentationMailbox {
myRights: myRights,
isSubscribed: isSubscribed,
namespace: namespace,
rights: rights
);
}
@@ -180,6 +187,7 @@ extension PresentationMailboxExtension on PresentationMailbox {
state: state,
namespace: namespace,
displayName: displayName,
rights: rights
);
}
@@ -201,6 +209,7 @@ extension PresentationMailboxExtension on PresentationMailbox {
state: state,
namespace: namespace,
displayName: displayName,
rights: rights
);
}
}