Hotfix conflict role Spam/Junk

This commit is contained in:
dab246
2024-08-14 17:04:43 +07:00
committed by Dat H. Pham
parent b5e3881ad4
commit 4d045bbf1a
33 changed files with 519 additions and 172 deletions
@@ -132,7 +132,7 @@ class FCMRepositoryImpl extends FCMRepository {
.where((presentationMailbox) => presentationMailbox.pushNotificationDeactivated)
.toList();
log('FCMRepositoryImpl::getMailboxesNotPutNotifications():mailboxesCacheNotPutNotifications: $mailboxesCacheNotPutNotifications');
if (mailboxesCacheNotPutNotifications.isNotEmpty && mailboxesCacheNotPutNotifications.length == FcmConstants.mailboxRuleDoNotAllowPushNotifications.length) {
if (mailboxesCacheNotPutNotifications.isNotEmpty) {
return mailboxesCacheNotPutNotifications;
} else {
final mailboxResponse = await _mapMailboxDataSource[DataSourceType.network]!.getAllMailbox(session, accountId);
@@ -1,16 +1,5 @@
import 'package:jmap_dart_client/jmap/mail/mailbox/mailbox.dart';
import 'package:model/mailbox/presentation_mailbox.dart';
class FcmConstants {
static final List<Role> mailboxRuleDoNotAllowPushNotifications = [
PresentationMailbox.roleDrafts,
PresentationMailbox.roleSent,
PresentationMailbox.roleOutbox,
PresentationMailbox.roleSpam,
PresentationMailbox.roleTrash
];
static const String firebaseRegistrationExpiredTimeProperty = 'expires';
static const int MAX_NUMBER_NEW_EMAILS_RETRIEVED = 5;