Use TupleKey(ObjectKey-AccountId-UserName) to store data to hive
(cherry picked from commit e0ace535d5f3af71eb13598d92524caf2c6d9bbf)
This commit is contained in:
@@ -3,15 +3,16 @@ import 'package:fcm/model/firebase_subscription.dart';
|
||||
import 'package:fcm/model/type_name.dart';
|
||||
import 'package:jmap_dart_client/jmap/account_id.dart';
|
||||
import 'package:jmap_dart_client/jmap/core/state.dart' as jmap;
|
||||
import 'package:jmap_dart_client/jmap/core/user_name.dart';
|
||||
import 'package:tmail_ui_user/features/push_notification/data/model/fcm_subscription.dart';
|
||||
import 'package:tmail_ui_user/features/push_notification/domain/model/register_new_token_request.dart';
|
||||
|
||||
abstract class FCMDatasource {
|
||||
Future<void> storeStateToRefresh(AccountId accountId, TypeName typeName, jmap.State newState);
|
||||
Future<void> storeStateToRefresh(AccountId accountId, UserName userName, TypeName typeName, jmap.State newState);
|
||||
|
||||
Future<jmap.State> getStateToRefresh(AccountId accountId, TypeName typeName);
|
||||
Future<jmap.State> getStateToRefresh(AccountId accountId, UserName userName, TypeName typeName);
|
||||
|
||||
Future<void> deleteStateToRefresh(AccountId accountId, TypeName typeName);
|
||||
Future<void> deleteStateToRefresh(AccountId accountId, UserName userName, TypeName typeName);
|
||||
|
||||
Future<void> storeSubscription(FCMSubscriptionCache fcmSubscriptionCache);
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ import 'package:fcm/model/firebase_subscription.dart';
|
||||
import 'package:fcm/model/type_name.dart';
|
||||
import 'package:jmap_dart_client/jmap/account_id.dart';
|
||||
import 'package:jmap_dart_client/jmap/core/state.dart' as jmap;
|
||||
import 'package:jmap_dart_client/jmap/core/user_name.dart';
|
||||
import 'package:tmail_ui_user/features/push_notification/data/datasource/fcm_datasource.dart';
|
||||
import 'package:tmail_ui_user/features/push_notification/data/local/fcm_cache_manager.dart';
|
||||
import 'package:tmail_ui_user/features/push_notification/data/model/fcm_subscription.dart';
|
||||
@@ -16,23 +17,23 @@ class CacheFCMDatasourceImpl extends FCMDatasource {
|
||||
CacheFCMDatasourceImpl(this._firebaseCacheManager, this._exceptionThrower);
|
||||
|
||||
@override
|
||||
Future<void> storeStateToRefresh(AccountId accountId, TypeName typeName, jmap.State newState) {
|
||||
Future<void> storeStateToRefresh(AccountId accountId, UserName userName, TypeName typeName, jmap.State newState) {
|
||||
return Future.sync(() async {
|
||||
return await _firebaseCacheManager.storeStateToRefresh(accountId, typeName, newState);
|
||||
return await _firebaseCacheManager.storeStateToRefresh(accountId, userName, typeName, newState);
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<jmap.State> getStateToRefresh(AccountId accountId, TypeName typeName) {
|
||||
Future<jmap.State> getStateToRefresh(AccountId accountId,UserName userName, TypeName typeName) {
|
||||
return Future.sync(() async {
|
||||
return await _firebaseCacheManager.getStateToRefresh(accountId, typeName);
|
||||
return await _firebaseCacheManager.getStateToRefresh(accountId, userName, typeName);
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> deleteStateToRefresh(AccountId accountId, TypeName typeName) {
|
||||
Future<void> deleteStateToRefresh(AccountId accountId, UserName userName, TypeName typeName) {
|
||||
return Future.sync(() async {
|
||||
return await _firebaseCacheManager.deleteStateToRefresh(accountId, typeName);
|
||||
return await _firebaseCacheManager.deleteStateToRefresh(accountId, userName, typeName);
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ import 'package:fcm/model/firebase_subscription.dart';
|
||||
import 'package:fcm/model/type_name.dart';
|
||||
import 'package:jmap_dart_client/jmap/account_id.dart';
|
||||
import 'package:jmap_dart_client/jmap/core/state.dart' as jmap;
|
||||
import 'package:jmap_dart_client/jmap/core/user_name.dart';
|
||||
import 'package:tmail_ui_user/features/push_notification/data/datasource/fcm_datasource.dart';
|
||||
import 'package:tmail_ui_user/features/push_notification/data/model/fcm_subscription.dart';
|
||||
import 'package:tmail_ui_user/features/push_notification/data/network/fcm_api.dart';
|
||||
@@ -24,17 +25,17 @@ class FcmDatasourceImpl extends FCMDatasource {
|
||||
}
|
||||
|
||||
@override
|
||||
Future<bool> deleteStateToRefresh(AccountId accountId, TypeName typeName) {
|
||||
Future<bool> deleteStateToRefresh(AccountId accountId, UserName userName, TypeName typeName) {
|
||||
throw UnimplementedError();
|
||||
}
|
||||
|
||||
@override
|
||||
Future<jmap.State> getStateToRefresh(AccountId accountId, TypeName typeName) {
|
||||
Future<jmap.State> getStateToRefresh(AccountId accountId, UserName userName, TypeName typeName) {
|
||||
throw UnimplementedError();
|
||||
}
|
||||
|
||||
@override
|
||||
Future<bool> storeStateToRefresh(AccountId accountId, TypeName typeName, jmap.State newState) {
|
||||
Future<bool> storeStateToRefresh(AccountId accountId, UserName userName, TypeName typeName, jmap.State newState) {
|
||||
throw UnimplementedError();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'package:fcm/model/type_name.dart';
|
||||
import 'package:jmap_dart_client/jmap/account_id.dart';
|
||||
import 'package:jmap_dart_client/jmap/core/user_name.dart';
|
||||
import 'package:model/extensions/account_id_extensions.dart';
|
||||
import 'package:tmail_ui_user/features/caching/fcm_cache_client.dart';
|
||||
import 'package:tmail_ui_user/features/caching/subscription_cache_client.dart';
|
||||
@@ -14,13 +15,13 @@ class FCMCacheManager {
|
||||
|
||||
FCMCacheManager(this._fcmCacheClient,this._fcmSubscriptionCacheClient);
|
||||
|
||||
Future<void> storeStateToRefresh(AccountId accountId, TypeName typeName, jmap.State newState) {
|
||||
final stateKeyCache = TupleKey(typeName.value, accountId.asString).toString();
|
||||
Future<void> storeStateToRefresh(AccountId accountId, UserName userName, TypeName typeName, jmap.State newState) {
|
||||
final stateKeyCache = TupleKey(typeName.value, accountId.asString, userName.value).encodeKey;
|
||||
return _fcmCacheClient.insertItem(stateKeyCache, newState.value);
|
||||
}
|
||||
|
||||
Future<jmap.State> getStateToRefresh(AccountId accountId, TypeName typeName) async {
|
||||
final stateKeyCache = TupleKey(typeName.value, accountId.asString).toString();
|
||||
Future<jmap.State> getStateToRefresh(AccountId accountId, UserName userName, TypeName typeName) async {
|
||||
final stateKeyCache = TupleKey(typeName.value, accountId.asString, userName.value).encodeKey;
|
||||
final stateValue = await _fcmCacheClient.getItem(stateKeyCache);
|
||||
if (stateValue != null) {
|
||||
return jmap.State(stateValue);
|
||||
@@ -33,8 +34,8 @@ class FCMCacheManager {
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> deleteStateToRefresh(AccountId accountId, TypeName typeName) {
|
||||
final stateKeyCache = TupleKey(typeName.value, accountId.asString).toString();
|
||||
Future<void> deleteStateToRefresh(AccountId accountId, UserName userName, TypeName typeName) {
|
||||
final stateKeyCache = TupleKey(typeName.value, accountId.asString, userName.value).encodeKey;
|
||||
return _fcmCacheClient.deleteItem(stateKeyCache);
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import 'package:fcm/model/type_name.dart';
|
||||
import 'package:jmap_dart_client/jmap/account_id.dart';
|
||||
import 'package:jmap_dart_client/jmap/core/properties/properties.dart';
|
||||
import 'package:jmap_dart_client/jmap/core/session/session.dart';
|
||||
import 'package:jmap_dart_client/jmap/core/user_name.dart';
|
||||
import 'package:jmap_dart_client/jmap/mail/email/email.dart';
|
||||
import 'package:jmap_dart_client/jmap/mail/email/keyword_identifier.dart';
|
||||
import 'package:model/extensions/list_email_extension.dart';
|
||||
@@ -75,18 +76,18 @@ class FCMRepositoryImpl extends FCMRepository {
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> storeStateToRefresh(AccountId accountId, TypeName typeName, jmap.State newState) {
|
||||
return _fcmDatasource[DataSourceType.local]!.storeStateToRefresh(accountId, typeName, newState);
|
||||
Future<void> storeStateToRefresh(AccountId accountId, UserName userName, TypeName typeName, jmap.State newState) {
|
||||
return _fcmDatasource[DataSourceType.local]!.storeStateToRefresh(accountId, userName, typeName, newState);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<jmap.State> getStateToRefresh(AccountId accountId, TypeName typeName) {
|
||||
return _fcmDatasource[DataSourceType.local]!.getStateToRefresh(accountId, typeName);
|
||||
Future<jmap.State> getStateToRefresh(AccountId accountId, UserName userName, TypeName typeName) {
|
||||
return _fcmDatasource[DataSourceType.local]!.getStateToRefresh(accountId, userName, typeName);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> deleteStateToRefresh(AccountId accountId, TypeName typeName) {
|
||||
return _fcmDatasource[DataSourceType.local]!.deleteStateToRefresh(accountId, typeName);
|
||||
Future<void> deleteStateToRefresh(AccountId accountId, UserName userName, TypeName typeName) {
|
||||
return _fcmDatasource[DataSourceType.local]!.deleteStateToRefresh(accountId, userName, typeName);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -117,7 +118,7 @@ class FCMRepositoryImpl extends FCMRepository {
|
||||
|
||||
@override
|
||||
Future<List<PresentationMailbox>> getMailboxesNotPutNotifications(Session session, AccountId accountId) async {
|
||||
final mailboxesCache = await _mapMailboxDataSource[DataSourceType.local]!.getAllMailboxCache(accountId);
|
||||
final mailboxesCache = await _mapMailboxDataSource[DataSourceType.local]!.getAllMailboxCache(accountId, session.username);
|
||||
final mailboxesCacheNotPutNotifications = mailboxesCache
|
||||
.map((mailbox) => mailbox.toPresentationMailbox())
|
||||
.where((presentationMailbox) => presentationMailbox.pushNotificationDeactivated)
|
||||
|
||||
@@ -3,6 +3,7 @@ import 'package:fcm/model/type_name.dart';
|
||||
import 'package:jmap_dart_client/jmap/account_id.dart';
|
||||
import 'package:jmap_dart_client/jmap/core/properties/properties.dart';
|
||||
import 'package:jmap_dart_client/jmap/core/session/session.dart';
|
||||
import 'package:jmap_dart_client/jmap/core/user_name.dart';
|
||||
import 'package:jmap_dart_client/jmap/mail/email/email.dart';
|
||||
import 'package:model/mailbox/presentation_mailbox.dart';
|
||||
import 'package:tmail_ui_user/features/push_notification/domain/model/fcm_subscription.dart';
|
||||
@@ -21,11 +22,11 @@ abstract class FCMRepository {
|
||||
}
|
||||
);
|
||||
|
||||
Future<void> storeStateToRefresh(AccountId accountId, TypeName typeName, jmap.State newState);
|
||||
Future<void> storeStateToRefresh(AccountId accountId, UserName userName, TypeName typeName, jmap.State newState);
|
||||
|
||||
Future<jmap.State> getStateToRefresh(AccountId accountId, TypeName typeName);
|
||||
Future<jmap.State> getStateToRefresh(AccountId accountId, UserName userName, TypeName typeName);
|
||||
|
||||
Future<void> deleteStateToRefresh(AccountId accountId, TypeName typeName);
|
||||
Future<void> deleteStateToRefresh(AccountId accountId, UserName userName, TypeName typeName);
|
||||
|
||||
Future<void> storeSubscription(FCMSubscription fcmSubscription);
|
||||
|
||||
|
||||
+4
-2
@@ -2,6 +2,7 @@
|
||||
import 'package:core/presentation/state/failure.dart';
|
||||
import 'package:core/presentation/state/success.dart';
|
||||
import 'package:jmap_dart_client/jmap/account_id.dart';
|
||||
import 'package:jmap_dart_client/jmap/core/user_name.dart';
|
||||
import 'package:model/email/presentation_email.dart';
|
||||
|
||||
class GetEmailChangesToPushNotificationLoading extends UIState {}
|
||||
@@ -10,11 +11,12 @@ class GetEmailChangesToPushNotificationSuccess extends UIState {
|
||||
|
||||
final List<PresentationEmail> emailList;
|
||||
final AccountId accountId;
|
||||
final UserName userName;
|
||||
|
||||
GetEmailChangesToPushNotificationSuccess(this.accountId, this.emailList);
|
||||
GetEmailChangesToPushNotificationSuccess(this.accountId, this.userName, this.emailList);
|
||||
|
||||
@override
|
||||
List<Object> get props => [accountId, emailList];
|
||||
List<Object> get props => [accountId, userName, emailList];
|
||||
}
|
||||
|
||||
class GetEmailChangesToPushNotificationFailure extends FeatureFailure {
|
||||
|
||||
+3
-2
@@ -3,6 +3,7 @@ import 'package:core/presentation/state/success.dart';
|
||||
import 'package:dartz/dartz.dart';
|
||||
import 'package:fcm/model/type_name.dart';
|
||||
import 'package:jmap_dart_client/jmap/account_id.dart';
|
||||
import 'package:jmap_dart_client/jmap/core/user_name.dart';
|
||||
import 'package:tmail_ui_user/features/push_notification/domain/repository/fcm_repository.dart';
|
||||
import 'package:tmail_ui_user/features/push_notification/domain/state/delete_email_state_to_refresh_state.dart';
|
||||
|
||||
@@ -11,10 +12,10 @@ class DeleteEmailStateToRefreshInteractor {
|
||||
|
||||
DeleteEmailStateToRefreshInteractor(this._fcmRepository);
|
||||
|
||||
Stream<Either<Failure, Success>> execute(AccountId accountId) async* {
|
||||
Stream<Either<Failure, Success>> execute(AccountId accountId, UserName userName) async* {
|
||||
try {
|
||||
yield Right<Failure, Success>(DeleteEmailStateToRefreshLoading());
|
||||
await _fcmRepository.deleteStateToRefresh(accountId, TypeName.emailType);
|
||||
await _fcmRepository.deleteStateToRefresh(accountId, userName, TypeName.emailType);
|
||||
yield Right<Failure, Success>(DeleteEmailStateToRefreshSuccess());
|
||||
} catch (e) {
|
||||
yield Left<Failure, Success>(DeleteEmailStateToRefreshFailure(e));
|
||||
|
||||
+3
-2
@@ -3,6 +3,7 @@ import 'package:core/presentation/state/success.dart';
|
||||
import 'package:dartz/dartz.dart';
|
||||
import 'package:fcm/model/type_name.dart';
|
||||
import 'package:jmap_dart_client/jmap/account_id.dart';
|
||||
import 'package:jmap_dart_client/jmap/core/user_name.dart';
|
||||
import 'package:tmail_ui_user/features/push_notification/domain/repository/fcm_repository.dart';
|
||||
import 'package:tmail_ui_user/features/push_notification/domain/state/delete_mailbox_state_to_refresh_state.dart';
|
||||
|
||||
@@ -11,10 +12,10 @@ class DeleteMailboxStateToRefreshInteractor {
|
||||
|
||||
DeleteMailboxStateToRefreshInteractor(this._fcmRepository);
|
||||
|
||||
Stream<Either<Failure, Success>> execute(AccountId accountId) async* {
|
||||
Stream<Either<Failure, Success>> execute(AccountId accountId, UserName userName) async* {
|
||||
try {
|
||||
yield Right<Failure, Success>(DeleteMailboxStateToRefreshLoading());
|
||||
await _fcmRepository.deleteStateToRefresh(accountId, TypeName.mailboxType);
|
||||
await _fcmRepository.deleteStateToRefresh(accountId, userName, TypeName.mailboxType);
|
||||
yield Right<Failure, Success>(DeleteMailboxStateToRefreshSuccess());
|
||||
} catch (e) {
|
||||
yield Left<Failure, Success>(DeleteMailboxStateToRefreshFailure(e));
|
||||
|
||||
+3
-1
@@ -5,6 +5,7 @@ import 'package:jmap_dart_client/jmap/account_id.dart';
|
||||
import 'package:jmap_dart_client/jmap/core/properties/properties.dart';
|
||||
import 'package:jmap_dart_client/jmap/core/session/session.dart';
|
||||
import 'package:jmap_dart_client/jmap/core/state.dart' as jmap;
|
||||
import 'package:jmap_dart_client/jmap/core/user_name.dart';
|
||||
import 'package:model/extensions/email_extension.dart';
|
||||
import 'package:tmail_ui_user/features/push_notification/domain/repository/fcm_repository.dart';
|
||||
import 'package:tmail_ui_user/features/push_notification/domain/state/get_email_changes_to_push_notification_state.dart';
|
||||
@@ -17,6 +18,7 @@ class GetEmailChangesToPushNotificationInteractor {
|
||||
Stream<Either<Failure, Success>> execute(
|
||||
Session session,
|
||||
AccountId accountId,
|
||||
UserName userName,
|
||||
jmap.State currentState,
|
||||
{
|
||||
Properties? propertiesCreated,
|
||||
@@ -37,7 +39,7 @@ class GetEmailChangesToPushNotificationInteractor {
|
||||
?.map((email) => email.toPresentationEmail())
|
||||
.toList() ?? List.empty();
|
||||
|
||||
yield Right<Failure, Success>(GetEmailChangesToPushNotificationSuccess(accountId, presentationEmailList));
|
||||
yield Right<Failure, Success>(GetEmailChangesToPushNotificationSuccess(accountId, userName, presentationEmailList));
|
||||
} catch (e) {
|
||||
yield Left<Failure, Success>(GetEmailChangesToPushNotificationFailure(e));
|
||||
}
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ class GetEmailChangesToRemoveNotificationInteractor {
|
||||
try {
|
||||
yield Right<Failure, Success>(GetEmailChangesToRemoveNotificationLoading());
|
||||
|
||||
final currentState = await _emailRepository.getEmailState(accountId);
|
||||
final currentState = await _emailRepository.getEmailState(session, accountId);
|
||||
log('GetEmailChangesToRemoveNotificationInteractor::execute():currentState: $currentState');
|
||||
if (currentState != null) {
|
||||
final emailIds = await _fcmRepository.getEmailChangesToRemoveNotification(
|
||||
|
||||
+3
-2
@@ -3,6 +3,7 @@ import 'package:core/presentation/state/success.dart';
|
||||
import 'package:dartz/dartz.dart';
|
||||
import 'package:fcm/model/type_name.dart';
|
||||
import 'package:jmap_dart_client/jmap/account_id.dart';
|
||||
import 'package:jmap_dart_client/jmap/core/user_name.dart';
|
||||
import 'package:tmail_ui_user/features/push_notification/domain/repository/fcm_repository.dart';
|
||||
import 'package:tmail_ui_user/features/push_notification/domain/state/get_email_state_to_refresh_state.dart';
|
||||
|
||||
@@ -11,10 +12,10 @@ class GetEmailStateToRefreshInteractor {
|
||||
|
||||
GetEmailStateToRefreshInteractor(this._fcmRepository);
|
||||
|
||||
Stream<Either<Failure, Success>> execute(AccountId accountId) async* {
|
||||
Stream<Either<Failure, Success>> execute(AccountId accountId, UserName userName) async* {
|
||||
try {
|
||||
yield Right<Failure, Success>(GetEmailStateToRefreshLoading());
|
||||
final storedState = await _fcmRepository.getStateToRefresh(accountId, TypeName.emailType);
|
||||
final storedState = await _fcmRepository.getStateToRefresh(accountId, userName, TypeName.emailType);
|
||||
yield Right<Failure, Success>(GetEmailStateToRefreshSuccess(storedState));
|
||||
} catch (e) {
|
||||
yield Left<Failure, Success>(GetEmailStateToRefreshFailure(e));
|
||||
|
||||
+3
-2
@@ -3,6 +3,7 @@ import 'package:core/presentation/state/success.dart';
|
||||
import 'package:dartz/dartz.dart';
|
||||
import 'package:fcm/model/type_name.dart';
|
||||
import 'package:jmap_dart_client/jmap/account_id.dart';
|
||||
import 'package:jmap_dart_client/jmap/core/user_name.dart';
|
||||
import 'package:tmail_ui_user/features/push_notification/domain/repository/fcm_repository.dart';
|
||||
import 'package:tmail_ui_user/features/push_notification/domain/state/get_mailbox_state_to_refresh_state.dart';
|
||||
|
||||
@@ -11,10 +12,10 @@ class GetMailboxStateToRefreshInteractor {
|
||||
|
||||
GetMailboxStateToRefreshInteractor(this._fcmRepository);
|
||||
|
||||
Stream<Either<Failure, Success>> execute(AccountId accountId) async* {
|
||||
Stream<Either<Failure, Success>> execute(AccountId accountId, UserName userName) async* {
|
||||
try {
|
||||
yield Right<Failure, Success>(GetMailboxStateToRefreshLoading());
|
||||
final storedState = await _fcmRepository.getStateToRefresh(accountId, TypeName.mailboxType);
|
||||
final storedState = await _fcmRepository.getStateToRefresh(accountId, userName, TypeName.mailboxType);
|
||||
yield Right<Failure, Success>(GetMailboxStateToRefreshSuccess(storedState));
|
||||
} catch (e) {
|
||||
yield Left<Failure, Success>(GetMailboxStateToRefreshFailure(e));
|
||||
|
||||
+3
-2
@@ -3,6 +3,7 @@ import 'package:core/presentation/state/success.dart';
|
||||
import 'package:dartz/dartz.dart';
|
||||
import 'package:fcm/model/type_name.dart';
|
||||
import 'package:jmap_dart_client/jmap/account_id.dart';
|
||||
import 'package:jmap_dart_client/jmap/core/user_name.dart';
|
||||
import 'package:tmail_ui_user/features/push_notification/domain/repository/fcm_repository.dart';
|
||||
import 'package:tmail_ui_user/features/push_notification/domain/state/get_stored_email_delivery_state.dart';
|
||||
|
||||
@@ -11,10 +12,10 @@ class GetStoredEmailDeliveryStateInteractor {
|
||||
|
||||
GetStoredEmailDeliveryStateInteractor(this._fcmRepository);
|
||||
|
||||
Stream<Either<Failure, Success>> execute(AccountId accountId) async* {
|
||||
Stream<Either<Failure, Success>> execute(AccountId accountId, UserName userName) async* {
|
||||
try {
|
||||
yield Right<Failure, Success>(GetStoredEmailDeliveryStateLoading());
|
||||
final storedState = await _fcmRepository.getStateToRefresh(accountId, TypeName.emailDelivery);
|
||||
final storedState = await _fcmRepository.getStateToRefresh(accountId, userName, TypeName.emailDelivery);
|
||||
yield Right<Failure, Success>(GetStoredEmailDeliveryStateSuccess(storedState));
|
||||
} catch (e) {
|
||||
yield Left<Failure, Success>(GetStoredEmailDeliveryStateFailure(e));
|
||||
|
||||
+3
-2
@@ -4,6 +4,7 @@ import 'package:dartz/dartz.dart';
|
||||
import 'package:fcm/model/type_name.dart';
|
||||
import 'package:jmap_dart_client/jmap/account_id.dart';
|
||||
import 'package:jmap_dart_client/jmap/core/state.dart' as jmap;
|
||||
import 'package:jmap_dart_client/jmap/core/user_name.dart';
|
||||
import 'package:tmail_ui_user/features/push_notification/domain/repository/fcm_repository.dart';
|
||||
import 'package:tmail_ui_user/features/push_notification/domain/state/store_email_delivery_state.dart';
|
||||
|
||||
@@ -12,10 +13,10 @@ class StoreEmailDeliveryStateInteractor {
|
||||
|
||||
StoreEmailDeliveryStateInteractor(this._fcmRepository);
|
||||
|
||||
Stream<Either<Failure, Success>> execute(AccountId accountId, jmap.State newState) async* {
|
||||
Stream<Either<Failure, Success>> execute(AccountId accountId, UserName userName, jmap.State newState) async* {
|
||||
try {
|
||||
yield Right<Failure, Success>(StoreEmailDeliveryStateLoading());
|
||||
await _fcmRepository.storeStateToRefresh(accountId, TypeName.emailDelivery, newState);
|
||||
await _fcmRepository.storeStateToRefresh(accountId, userName, TypeName.emailDelivery, newState);
|
||||
yield Right<Failure, Success>(StoreEmailDeliveryStateSuccess());
|
||||
} catch (e) {
|
||||
yield Left<Failure, Success>(StoreEmailDeliveryStateFailure(e));
|
||||
|
||||
+3
-2
@@ -4,6 +4,7 @@ import 'package:dartz/dartz.dart';
|
||||
import 'package:fcm/model/type_name.dart';
|
||||
import 'package:jmap_dart_client/jmap/account_id.dart';
|
||||
import 'package:jmap_dart_client/jmap/core/state.dart' as jmap;
|
||||
import 'package:jmap_dart_client/jmap/core/user_name.dart';
|
||||
import 'package:tmail_ui_user/features/push_notification/domain/repository/fcm_repository.dart';
|
||||
import 'package:tmail_ui_user/features/push_notification/domain/state/store_email_state_to_refresh_state.dart';
|
||||
|
||||
@@ -12,10 +13,10 @@ class StoreEmailStateToRefreshInteractor {
|
||||
|
||||
StoreEmailStateToRefreshInteractor(this._fcmRepository);
|
||||
|
||||
Stream<Either<Failure, Success>> execute(AccountId accountId, jmap.State newState) async* {
|
||||
Stream<Either<Failure, Success>> execute(AccountId accountId, UserName userName, jmap.State newState) async* {
|
||||
try {
|
||||
yield Right<Failure, Success>(StoreEmailStateToRefreshLoading());
|
||||
await _fcmRepository.storeStateToRefresh(accountId, TypeName.emailType, newState);
|
||||
await _fcmRepository.storeStateToRefresh(accountId, userName, TypeName.emailType, newState);
|
||||
yield Right<Failure, Success>(StoreEmailStateToRefreshSuccess());
|
||||
} catch (e) {
|
||||
yield Left<Failure, Success>(StoreEmailStateToRefreshFailure(e));
|
||||
|
||||
+3
-2
@@ -4,6 +4,7 @@ import 'package:dartz/dartz.dart';
|
||||
import 'package:fcm/model/type_name.dart';
|
||||
import 'package:jmap_dart_client/jmap/account_id.dart';
|
||||
import 'package:jmap_dart_client/jmap/core/state.dart' as jmap;
|
||||
import 'package:jmap_dart_client/jmap/core/user_name.dart';
|
||||
import 'package:tmail_ui_user/features/push_notification/domain/repository/fcm_repository.dart';
|
||||
import 'package:tmail_ui_user/features/push_notification/domain/state/store_mailbox_state_to_refresh_state.dart';
|
||||
|
||||
@@ -12,10 +13,10 @@ class StoreMailboxStateToRefreshInteractor {
|
||||
|
||||
StoreMailboxStateToRefreshInteractor(this._fcmRepository);
|
||||
|
||||
Stream<Either<Failure, Success>> execute(AccountId accountId, jmap.State newState) async* {
|
||||
Stream<Either<Failure, Success>> execute(AccountId accountId, UserName userName, jmap.State newState) async* {
|
||||
try {
|
||||
yield Right<Failure, Success>(StoreMailboxStateToRefreshLoading());
|
||||
await _fcmRepository.storeStateToRefresh(accountId, TypeName.mailboxType, newState);
|
||||
await _fcmRepository.storeStateToRefresh(accountId, userName, TypeName.mailboxType, newState);
|
||||
yield Right<Failure, Success>(StoreMailboxStateToRefreshSuccess());
|
||||
} catch (e) {
|
||||
yield Left<Failure, Success>(StoreMailboxStateToRefreshFailure(e));
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
import 'package:fcm/model/type_name.dart';
|
||||
import 'package:jmap_dart_client/jmap/account_id.dart';
|
||||
import 'package:jmap_dart_client/jmap/core/session/session.dart';
|
||||
import 'package:jmap_dart_client/jmap/core/user_name.dart';
|
||||
import 'package:tmail_ui_user/features/base/action/ui_action.dart';
|
||||
import 'package:jmap_dart_client/jmap/core/state.dart' as jmap;
|
||||
|
||||
@@ -25,27 +26,31 @@ class PushNotificationAction extends FcmStateChangeAction {
|
||||
|
||||
final Session? session;
|
||||
final AccountId accountId;
|
||||
final UserName userName;
|
||||
|
||||
PushNotificationAction(
|
||||
TypeName typeName,
|
||||
jmap.State newState,
|
||||
this.session,
|
||||
this.accountId
|
||||
this.accountId,
|
||||
this.userName
|
||||
) : super(typeName, newState);
|
||||
|
||||
@override
|
||||
List<Object?> get props => [typeName, newState, accountId, session];
|
||||
List<Object?> get props => [typeName, newState, accountId, session, userName];
|
||||
}
|
||||
|
||||
class StoreEmailStateToRefreshAction extends FcmStateChangeAction {
|
||||
|
||||
final AccountId accountId;
|
||||
final UserName userName;
|
||||
final Session? session;
|
||||
|
||||
StoreEmailStateToRefreshAction(
|
||||
TypeName typeName,
|
||||
jmap.State newState,
|
||||
this.accountId,
|
||||
this.userName,
|
||||
this.session
|
||||
) : super(typeName, newState);
|
||||
|
||||
@@ -70,13 +75,15 @@ class SynchronizeMailboxOnForegroundAction extends FcmStateChangeAction {
|
||||
class StoreMailboxStateToRefreshAction extends FcmStateChangeAction {
|
||||
|
||||
final AccountId accountId;
|
||||
final UserName userName;
|
||||
|
||||
StoreMailboxStateToRefreshAction(
|
||||
TypeName typeName,
|
||||
jmap.State newState,
|
||||
this.accountId
|
||||
this.accountId,
|
||||
this.userName
|
||||
) : super(typeName, newState);
|
||||
|
||||
@override
|
||||
List<Object?> get props => [typeName, newState, accountId];
|
||||
List<Object?> get props => [typeName, newState, accountId, userName];
|
||||
}
|
||||
+19
-12
@@ -12,6 +12,7 @@ import 'package:firebase_messaging/firebase_messaging.dart';
|
||||
import 'package:jmap_dart_client/jmap/account_id.dart';
|
||||
import 'package:jmap_dart_client/jmap/core/session/session.dart';
|
||||
import 'package:jmap_dart_client/jmap/core/state.dart' as jmap;
|
||||
import 'package:jmap_dart_client/jmap/core/user_name.dart';
|
||||
import 'package:jmap_dart_client/jmap/push/state_change.dart';
|
||||
import 'package:model/oidc/token_oidc.dart';
|
||||
import 'package:rxdart/rxdart.dart';
|
||||
@@ -42,6 +43,7 @@ class FcmMessageController extends FcmBaseController {
|
||||
|
||||
AccountId? _currentAccountId;
|
||||
Session? _currentSession;
|
||||
UserName? _userName;
|
||||
RemoteMessage? _remoteMessageBackground;
|
||||
|
||||
GetAuthenticatedAccountInteractor? _getAuthenticatedAccountInteractor;
|
||||
@@ -60,6 +62,7 @@ class FcmMessageController extends FcmBaseController {
|
||||
void initializeFromAccountId(AccountId accountId, Session session) {
|
||||
_currentAccountId = accountId;
|
||||
_currentSession = session;
|
||||
_userName = session.username;
|
||||
FcmTokenController.instance.initialize();
|
||||
}
|
||||
|
||||
@@ -96,10 +99,10 @@ class FcmMessageController extends FcmBaseController {
|
||||
|
||||
void _handleForegroundMessageAction(RemoteMessage newRemoteMessage) {
|
||||
log('FcmMessageController::_handleForegroundMessageAction():remoteMessage: ${newRemoteMessage.data} | _currentAccountId: $_currentAccountId');
|
||||
if (_currentAccountId != null) {
|
||||
if (_currentAccountId != null && _userName != null) {
|
||||
final stateChange = _convertRemoteMessageToStateChange(newRemoteMessage);
|
||||
final mapTypeState = stateChange.getMapTypeState(_currentAccountId!);
|
||||
_mappingTypeStateToAction(mapTypeState, _currentAccountId!, session: _currentSession);
|
||||
_mappingTypeStateToAction(mapTypeState, _currentAccountId!, _userName!, session: _currentSession);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -116,7 +119,8 @@ class FcmMessageController extends FcmBaseController {
|
||||
|
||||
void _mappingTypeStateToAction(
|
||||
Map<String, dynamic> mapTypeState,
|
||||
AccountId accountId, {
|
||||
AccountId accountId,
|
||||
UserName userName, {
|
||||
bool isForeground = true,
|
||||
Session? session
|
||||
}) {
|
||||
@@ -127,7 +131,7 @@ class FcmMessageController extends FcmBaseController {
|
||||
|
||||
final listEmailActions = listTypeName
|
||||
.where((typeName) => typeName == TypeName.emailType || typeName == TypeName.emailDelivery)
|
||||
.map((typeName) => toFcmAction(typeName, accountId, mapTypeState, isForeground, session: session))
|
||||
.map((typeName) => toFcmAction(typeName, accountId, userName, mapTypeState, isForeground, session: session))
|
||||
.whereNotNull()
|
||||
.toList();
|
||||
|
||||
@@ -139,7 +143,7 @@ class FcmMessageController extends FcmBaseController {
|
||||
|
||||
final listMailboxActions = listTypeName
|
||||
.where((typeName) => typeName == TypeName.mailboxType)
|
||||
.map((typeName) => toFcmAction(typeName, accountId, mapTypeState, isForeground))
|
||||
.map((typeName) => toFcmAction(typeName, accountId, userName, mapTypeState, isForeground))
|
||||
.whereNotNull()
|
||||
.toList();
|
||||
|
||||
@@ -153,6 +157,7 @@ class FcmMessageController extends FcmBaseController {
|
||||
FcmAction? toFcmAction(
|
||||
TypeName typeName,
|
||||
AccountId accountId,
|
||||
UserName userName,
|
||||
Map<String, dynamic> mapTypeState,
|
||||
isForeground,
|
||||
{
|
||||
@@ -164,17 +169,17 @@ class FcmMessageController extends FcmBaseController {
|
||||
if (isForeground) {
|
||||
return SynchronizeEmailOnForegroundAction(typeName, newState, accountId, session);
|
||||
} else {
|
||||
return StoreEmailStateToRefreshAction(typeName, newState, accountId, session);
|
||||
return StoreEmailStateToRefreshAction(typeName, newState, accountId, userName, session);
|
||||
}
|
||||
} else if (typeName == TypeName.emailDelivery) {
|
||||
if (!isForeground) {
|
||||
return PushNotificationAction(typeName, newState, session, accountId);
|
||||
return PushNotificationAction(typeName, newState, session, accountId, userName);
|
||||
}
|
||||
} else if (typeName == TypeName.mailboxType) {
|
||||
if (isForeground) {
|
||||
return SynchronizeMailboxOnForegroundAction(typeName, newState, accountId);
|
||||
} else {
|
||||
return StoreMailboxStateToRefreshAction(typeName, newState, accountId);
|
||||
return StoreMailboxStateToRefreshAction(typeName, newState, accountId, userName);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
@@ -219,10 +224,11 @@ class FcmMessageController extends FcmBaseController {
|
||||
|
||||
void _handleGetAuthenticatedAccountSuccess(GetAuthenticatedAccountSuccess success) {
|
||||
_currentAccountId = success.account.accountId;
|
||||
_userName = success.account.userName;
|
||||
if (!FcmUtils.instance.isMobileAndroid) {
|
||||
_dynamicUrlInterceptors?.changeBaseUrl(success.account.apiUrl);
|
||||
}
|
||||
log('FcmMessageController::_handleGetAuthenticatedAccountSuccess():_currentAccountId: $_currentAccountId');
|
||||
log('FcmMessageController::_handleGetAuthenticatedAccountSuccess():_currentAccountId: $_currentAccountId | _userName: $_userName');
|
||||
}
|
||||
|
||||
void _handleGetAccountByOidcSuccess(GetStoredTokenOidcSuccess storedTokenOidcSuccess) {
|
||||
@@ -245,7 +251,7 @@ class FcmMessageController extends FcmBaseController {
|
||||
log('FcmMessageController::_handleGetAccountByBasicAuthSuccess():');
|
||||
_dynamicUrlInterceptors?.setJmapUrl(credentialViewState.baseUrl.toString());
|
||||
_authorizationInterceptors?.setBasicAuthorization(
|
||||
credentialViewState.userName.userName,
|
||||
credentialViewState.userName.value,
|
||||
credentialViewState.password.value,
|
||||
);
|
||||
if (FcmUtils.instance.isMobileAndroid) {
|
||||
@@ -267,6 +273,7 @@ class FcmMessageController extends FcmBaseController {
|
||||
|
||||
void _handleGetSessionSuccess(GetSessionSuccess success) {
|
||||
_currentSession = success.session;
|
||||
_userName = success.session.username;
|
||||
final jmapUrl = _dynamicUrlInterceptors?.jmapUrl;
|
||||
final apiUrl = jmapUrl != null
|
||||
? success.session.apiUrl.toQualifiedUrl(baseUrl: Uri.parse(jmapUrl)).toString()
|
||||
@@ -283,10 +290,10 @@ class FcmMessageController extends FcmBaseController {
|
||||
|
||||
void _pushActionFromRemoteMessageBackground() {
|
||||
log('FcmMessageController::_pushActionFromRemoteMessageBackground():_remoteMessageBackground: $_remoteMessageBackground | _currentAccountId: $_currentAccountId | _currentSession: $_currentSession');
|
||||
if (_remoteMessageBackground != null && _currentAccountId != null) {
|
||||
if (_remoteMessageBackground != null && _currentAccountId != null && _userName != null) {
|
||||
final stateChange = _convertRemoteMessageToStateChange(_remoteMessageBackground!);
|
||||
final mapTypeState = stateChange.getMapTypeState(_currentAccountId!);
|
||||
_mappingTypeStateToAction(mapTypeState, _currentAccountId!, isForeground: false, session: _currentSession);
|
||||
_mappingTypeStateToAction(mapTypeState, _currentAccountId!, _userName!, isForeground: false, session: _currentSession);
|
||||
}
|
||||
_clearRemoteMessageBackground();
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import 'package:jmap_dart_client/jmap/account_id.dart';
|
||||
import 'package:jmap_dart_client/jmap/core/properties/properties.dart';
|
||||
import 'package:jmap_dart_client/jmap/core/session/session.dart';
|
||||
import 'package:jmap_dart_client/jmap/core/state.dart' as jmap;
|
||||
import 'package:jmap_dart_client/jmap/core/user_name.dart';
|
||||
import 'package:jmap_dart_client/jmap/mail/email/email.dart';
|
||||
import 'package:model/email/email_property.dart';
|
||||
import 'package:model/email/presentation_email.dart';
|
||||
@@ -54,6 +55,7 @@ class EmailChangeListener extends ChangeListener {
|
||||
jmap.State? _newStateEmailDelivery;
|
||||
AccountId? _accountId;
|
||||
Session? _session;
|
||||
UserName? _userName;
|
||||
List<PresentationEmail> _emailsAvailablePushNotification = [];
|
||||
|
||||
EmailChangeListener._internal() {
|
||||
@@ -85,12 +87,12 @@ class EmailChangeListener extends ChangeListener {
|
||||
}
|
||||
_synchronizeEmailOnForegroundAction(action.newState);
|
||||
} else if (action is PushNotificationAction) {
|
||||
_pushNotificationAction(action.newState, action.accountId, action.session);
|
||||
_pushNotificationAction(action.newState, action.accountId, action.userName, action.session);
|
||||
} else if (action is StoreEmailStateToRefreshAction) {
|
||||
if (FcmUtils.instance.isMobileAndroid) {
|
||||
_handleRemoveNotificationWhenEmailMarkAsRead(action.newState, action.accountId, action.session);
|
||||
}
|
||||
_handleStoreEmailStateToRefreshAction(action.accountId, action.newState);
|
||||
_handleStoreEmailStateToRefreshAction(action.accountId, action.userName, action.newState);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -102,19 +104,20 @@ class EmailChangeListener extends ChangeListener {
|
||||
}
|
||||
}
|
||||
|
||||
void _pushNotificationAction(jmap.State newState, AccountId accountId, Session? session) {
|
||||
void _pushNotificationAction(jmap.State newState, AccountId accountId, UserName userName, Session? session) {
|
||||
_newStateEmailDelivery = newState;
|
||||
_accountId = accountId;
|
||||
_session = session;
|
||||
_userName = userName;
|
||||
log('EmailChangeListener::_pushNotificationAction():newState: $newState');
|
||||
|
||||
if (BuildUtils.isWeb) {
|
||||
_storeEmailDeliveryStateAction(accountId, _newStateEmailDelivery!);
|
||||
_storeEmailDeliveryStateAction(accountId, userName, _newStateEmailDelivery!);
|
||||
} else {
|
||||
if (Platform.isAndroid) {
|
||||
_getStoredEmailDeliveryState(accountId);
|
||||
_getStoredEmailDeliveryState(accountId, userName);
|
||||
} else if (Platform.isIOS) {
|
||||
_storeEmailDeliveryStateAction(accountId, _newStateEmailDelivery!);
|
||||
_storeEmailDeliveryStateAction(accountId, userName, _newStateEmailDelivery!);
|
||||
_showLocalNotificationForIOS(_newStateEmailDelivery!, accountId);
|
||||
} else {
|
||||
logError('EmailChangeListener::_pushNotificationAction(): NOT SUPPORTED PLATFORM');
|
||||
@@ -122,25 +125,29 @@ class EmailChangeListener extends ChangeListener {
|
||||
}
|
||||
}
|
||||
|
||||
void _getStoredEmailDeliveryState(AccountId accountId) {
|
||||
void _getStoredEmailDeliveryState(AccountId accountId, UserName userName) {
|
||||
if (_getStoredEmailDeliveryStateInteractor != null) {
|
||||
consumeState(_getStoredEmailDeliveryStateInteractor!.execute(accountId));
|
||||
consumeState(_getStoredEmailDeliveryStateInteractor!.execute(accountId, userName));
|
||||
}
|
||||
}
|
||||
|
||||
void _getStoredEmailState() {
|
||||
if (_getStoredEmailStateInteractor != null && _accountId != null) {
|
||||
consumeState(_getStoredEmailStateInteractor!.execute(_accountId!));
|
||||
if (_getStoredEmailStateInteractor != null && _session != null && _accountId != null) {
|
||||
consumeState(_getStoredEmailStateInteractor!.execute(_session!, _accountId!));
|
||||
} else {
|
||||
logError('EmailChangeListener::_getStoredEmailState(): _getStoredEmailStateInteractor is null');
|
||||
}
|
||||
}
|
||||
|
||||
void _getEmailChangesAction(jmap.State state) {
|
||||
if (_getEmailChangesToPushNotificationInteractor != null && _accountId != null && _session != null) {
|
||||
if (_getEmailChangesToPushNotificationInteractor != null &&
|
||||
_accountId != null &&
|
||||
_session != null &&
|
||||
_userName != null) {
|
||||
consumeState(_getEmailChangesToPushNotificationInteractor!.execute(
|
||||
_session!,
|
||||
_accountId!,
|
||||
_userName!,
|
||||
state,
|
||||
propertiesCreated: ThreadConstants.propertiesDefault,
|
||||
propertiesUpdated: ThreadConstants.propertiesUpdatedDefault,
|
||||
@@ -148,9 +155,9 @@ class EmailChangeListener extends ChangeListener {
|
||||
}
|
||||
}
|
||||
|
||||
void _storeEmailDeliveryStateAction(AccountId accountId, jmap.State state) {
|
||||
void _storeEmailDeliveryStateAction(AccountId accountId, UserName userName, jmap.State state) {
|
||||
if (_storeEmailDeliveryStateInteractor != null) {
|
||||
consumeState(_storeEmailDeliveryStateInteractor!.execute(accountId, state));
|
||||
consumeState(_storeEmailDeliveryStateInteractor!.execute(accountId, userName, state));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -204,7 +211,7 @@ class EmailChangeListener extends ChangeListener {
|
||||
_getEmailChangesAction(success.state);
|
||||
} else if (success is GetEmailChangesToPushNotificationSuccess) {
|
||||
if (_newStateEmailDelivery != null) {
|
||||
_storeEmailDeliveryStateAction(success.accountId, _newStateEmailDelivery!);
|
||||
_storeEmailDeliveryStateAction(success.accountId, success.userName, _newStateEmailDelivery!);
|
||||
|
||||
if (FcmUtils.instance.isMobileAndroid) {
|
||||
_handleListEmailToPushNotification(success.emailList);
|
||||
@@ -244,10 +251,10 @@ class EmailChangeListener extends ChangeListener {
|
||||
_emailsAvailablePushNotification.clear();
|
||||
}
|
||||
|
||||
void _handleStoreEmailStateToRefreshAction(AccountId accountId, jmap.State newState) {
|
||||
void _handleStoreEmailStateToRefreshAction(AccountId accountId, UserName userName, jmap.State newState) {
|
||||
log('EmailChangeListener::_handleStoreEmailStateToRefreshAction():newState: $newState');
|
||||
if (_storeEmailStateToRefreshInteractor != null) {
|
||||
consumeState(_storeEmailStateToRefreshInteractor!.execute(accountId, newState));
|
||||
consumeState(_storeEmailStateToRefreshInteractor!.execute(accountId, userName, newState));
|
||||
} else {
|
||||
logError('EmailChangeListener::_handleStoreEmailStateToRefreshAction():_storeEmailStateToRefreshInteractor is null');
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import 'package:core/presentation/state/success.dart';
|
||||
import 'package:core/utils/app_logger.dart';
|
||||
import 'package:jmap_dart_client/jmap/account_id.dart';
|
||||
import 'package:jmap_dart_client/jmap/core/state.dart' as jmap;
|
||||
import 'package:jmap_dart_client/jmap/core/user_name.dart';
|
||||
import 'package:tmail_ui_user/features/base/action/ui_action.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox/presentation/action/mailbox_ui_action.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox_dashboard/presentation/controller/mailbox_dashboard_controller.dart';
|
||||
@@ -37,7 +38,7 @@ class MailboxChangeListener extends ChangeListener {
|
||||
if (action is SynchronizeMailboxOnForegroundAction) {
|
||||
_synchronizeMailboxOnForegroundAction(action.newState);
|
||||
} else if (action is StoreMailboxStateToRefreshAction) {
|
||||
_handleStoreMailboxStateToRefreshAction(action.accountId, action.newState);
|
||||
_handleStoreMailboxStateToRefreshAction(action.accountId, action.userName, action.newState);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -59,10 +60,10 @@ class MailboxChangeListener extends ChangeListener {
|
||||
}
|
||||
}
|
||||
|
||||
void _handleStoreMailboxStateToRefreshAction(AccountId accountId, jmap.State newState) {
|
||||
void _handleStoreMailboxStateToRefreshAction(AccountId accountId, UserName userName, jmap.State newState) {
|
||||
log('MailboxChangeListener::_handleStoreMailboxStateToRefreshAction():newState: $newState');
|
||||
if (_storeMailboxStateToRefreshInteractor != null) {
|
||||
consumeState(_storeMailboxStateToRefreshInteractor!.execute(accountId, newState));
|
||||
consumeState(_storeMailboxStateToRefreshInteractor!.execute(accountId, userName, newState));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user