TF-2871 Block notification on folders Sent, Outbox, Drafts, Spam and Trash

This commit is contained in:
dab246
2024-07-16 09:40:12 +07:00
committed by Dat H. Pham
parent 501d4d38d9
commit 7b5c0d5a75
20 changed files with 253 additions and 81 deletions
@@ -6,6 +6,18 @@ extension MailboxExtension on Mailbox {
bool hasRole() => role != null && role!.value.isNotEmpty;
bool get isSpam => role == PresentationMailbox.roleSpam;
bool get isTrash => role == PresentationMailbox.roleTrash;
bool get isDrafts => role == PresentationMailbox.roleDrafts;
bool get isSent => role == PresentationMailbox.roleSent;
bool get isOutbox => name?.name == PresentationMailbox.outboxRole || role == PresentationMailbox.roleOutbox;
bool get pushNotificationDeactivated => isOutbox || isSent || isDrafts || isTrash || isSpam;
PresentationMailbox toPresentationMailbox() {
return PresentationMailbox(
id!,