TF-2871 Block notification on folders Sent, Outbox, Drafts, Spam and Trash
This commit is contained in:
@@ -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!,
|
||||
|
||||
@@ -14,7 +14,7 @@ class PresentationMailbox with EquatableMixin {
|
||||
static const String templatesRole= 'templates';
|
||||
static const String outboxRole = 'outbox';
|
||||
static const String draftsRole = 'drafts';
|
||||
static const String spamRole = 'spam';
|
||||
static const String spamRole = 'junk';
|
||||
static const String archiveRole = 'archive';
|
||||
static const String recoveredRole = 'restored messages';
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
|
||||
import 'package:core/utils/app_logger.dart';
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
import 'package:model/oidc/converter/token_id_converter.dart';
|
||||
@@ -39,6 +40,8 @@ extension TokenOIDCExtension on TokenOIDC {
|
||||
bool get isExpired {
|
||||
if (expiredTime != null) {
|
||||
final now = DateTime.now();
|
||||
log('TokenOIDC::isExpired(): TIME_NOW: $now');
|
||||
log('TokenOIDC::isExpired(): EXPIRED_DATE: $expiredTime');
|
||||
return expiredTime!.isBefore(now);
|
||||
}
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user