TF-3449 Setup Sender-set important flag in Setting View
Signed-off-by: dab246 <tdvu@linagora.com>
This commit is contained in:
@@ -50,18 +50,14 @@ import 'package:tmail_ui_user/features/mailbox/domain/repository/mailbox_reposit
|
||||
import 'package:tmail_ui_user/features/mailbox_dashboard/domain/repository/composer_cache_repository.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox_dashboard/domain/usecases/remove_composer_cache_on_web_interactor.dart';
|
||||
import 'package:tmail_ui_user/features/manage_account/domain/usecases/get_all_identities_interactor.dart';
|
||||
import 'package:tmail_ui_user/features/manage_account/presentation/preferences/bindings/preferences_interactors_bindings.dart';
|
||||
import 'package:tmail_ui_user/features/manage_account/presentation/profiles/identities/identity_interactors_bindings.dart';
|
||||
import 'package:tmail_ui_user/features/offline_mode/manager/new_email_cache_manager.dart';
|
||||
import 'package:tmail_ui_user/features/offline_mode/manager/new_email_cache_worker_queue.dart';
|
||||
import 'package:tmail_ui_user/features/offline_mode/manager/opened_email_cache_manager.dart';
|
||||
import 'package:tmail_ui_user/features/offline_mode/manager/opened_email_cache_worker_queue.dart';
|
||||
import 'package:tmail_ui_user/features/offline_mode/manager/sending_email_cache_manager.dart';
|
||||
import 'package:tmail_ui_user/features/server_settings/data/datasource/server_settings_data_source.dart';
|
||||
import 'package:tmail_ui_user/features/server_settings/data/datasource_impl/remote_server_settings_data_source_impl.dart';
|
||||
import 'package:tmail_ui_user/features/server_settings/data/network/server_settings_api.dart';
|
||||
import 'package:tmail_ui_user/features/server_settings/data/repository/server_settings_repository_impl.dart';
|
||||
import 'package:tmail_ui_user/features/server_settings/domain/repository/server_settings_repository.dart';
|
||||
import 'package:tmail_ui_user/features/server_settings/domain/usecases/get_always_read_receipt_setting_interactor.dart';
|
||||
import 'package:tmail_ui_user/features/server_settings/domain/usecases/get_server_setting_interactor.dart';
|
||||
import 'package:tmail_ui_user/features/thread/data/local/email_cache_manager.dart';
|
||||
import 'package:tmail_ui_user/features/upload/data/datasource/attachment_upload_datasource.dart';
|
||||
import 'package:tmail_ui_user/features/upload/data/datasource_impl/attachment_upload_datasource_impl.dart';
|
||||
@@ -141,9 +137,6 @@ class ComposerBindings extends BaseBindings {
|
||||
Get.lazyPut(() => EmailSessionStorageDatasourceImpl(
|
||||
Get.find<SessionStorageManager>(),
|
||||
Get.find<CacheExceptionThrower>()));
|
||||
Get.lazyPut(() => RemoteServerSettingsDataSourceImpl(
|
||||
Get.find<ServerSettingsAPI>(),
|
||||
Get.find<RemoteExceptionThrower>()));
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -156,8 +149,6 @@ class ComposerBindings extends BaseBindings {
|
||||
Get.lazyPut<HtmlDataSource>(() => Get.find<HtmlDataSourceImpl>());
|
||||
Get.lazyPut<StateDataSource>(() => Get.find<StateDataSourceImpl>());
|
||||
Get.lazyPut<PrintFileDataSource>(() => Get.find<PrintFileDataSourceImpl>());
|
||||
Get.lazyPut<ServerSettingsDataSource>(
|
||||
() => Get.find<RemoteServerSettingsDataSourceImpl>());
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -188,9 +179,6 @@ class ComposerBindings extends BaseBindings {
|
||||
Get.find<StateDataSource>(),
|
||||
Get.find<PrintFileDataSource>(),
|
||||
));
|
||||
Get.lazyPut(() => ServerSettingsRepositoryImpl(
|
||||
Get.find<ServerSettingsDataSource>(),
|
||||
));
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -199,7 +187,6 @@ class ComposerBindings extends BaseBindings {
|
||||
Get.lazyPut<ContactRepository>(() => Get.find<ContactRepositoryImpl>());
|
||||
Get.lazyPut<MailboxRepository>(() => Get.find<MailboxRepositoryImpl>());
|
||||
Get.lazyPut<EmailRepository>(() => Get.find<EmailRepositoryImpl>());
|
||||
Get.lazyPut<ServerSettingsRepository>(() => Get.find<ServerSettingsRepositoryImpl>());
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -215,7 +202,6 @@ class ComposerBindings extends BaseBindings {
|
||||
));
|
||||
Get.lazyPut(() => DownloadImageAsBase64Interactor(Get.find<ComposerRepository>()));
|
||||
Get.lazyPut(() => TransformHtmlEmailContentInteractor(Get.find<EmailRepository>()));
|
||||
Get.lazyPut(() => GetAlwaysReadReceiptSettingInteractor(Get.find<ServerSettingsRepository>()));
|
||||
Get.lazyPut(() => CreateNewAndSendEmailInteractor(
|
||||
Get.find<EmailRepository>(),
|
||||
Get.find<ComposerRepository>(),
|
||||
@@ -230,6 +216,7 @@ class ComposerBindings extends BaseBindings {
|
||||
Get.find<EmailRepository>()));
|
||||
|
||||
IdentityInteractorsBindings().dependencies();
|
||||
PreferencesInteractorsBindings().dependencies();
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -250,7 +237,7 @@ class ComposerBindings extends BaseBindings {
|
||||
Get.find<SaveComposerCacheOnWebInteractor>(),
|
||||
Get.find<DownloadImageAsBase64Interactor>(),
|
||||
Get.find<TransformHtmlEmailContentInteractor>(),
|
||||
Get.find<GetAlwaysReadReceiptSettingInteractor>(),
|
||||
Get.find<GetServerSettingInteractor>(),
|
||||
Get.find<CreateNewAndSendEmailInteractor>(),
|
||||
Get.find<CreateNewAndSaveEmailToDraftsInteractor>(),
|
||||
Get.find<PrintEmailInteractor>(),
|
||||
|
||||
@@ -29,6 +29,7 @@ import 'package:permission_handler/permission_handler.dart';
|
||||
import 'package:pointer_interceptor/pointer_interceptor.dart';
|
||||
import 'package:receive_sharing_intent/receive_sharing_intent.dart';
|
||||
import 'package:rich_text_composer/rich_text_composer.dart';
|
||||
import 'package:server_settings/server_settings/tmail_server_settings_extension.dart';
|
||||
import 'package:super_tag_editor/tag_editor.dart';
|
||||
import 'package:tmail_ui_user/features/base/base_controller.dart';
|
||||
import 'package:tmail_ui_user/features/base/before_reconnect_handler.dart';
|
||||
@@ -93,8 +94,8 @@ import 'package:tmail_ui_user/features/manage_account/presentation/extensions/id
|
||||
import 'package:tmail_ui_user/features/network_connection/presentation/network_connection_controller.dart'
|
||||
if (dart.library.html) 'package:tmail_ui_user/features/network_connection/presentation/web_network_connection_controller.dart';
|
||||
import 'package:tmail_ui_user/features/sending_queue/domain/model/sending_email.dart';
|
||||
import 'package:tmail_ui_user/features/server_settings/domain/state/get_always_read_receipt_setting_state.dart';
|
||||
import 'package:tmail_ui_user/features/server_settings/domain/usecases/get_always_read_receipt_setting_interactor.dart';
|
||||
import 'package:tmail_ui_user/features/server_settings/domain/state/get_server_setting_state.dart';
|
||||
import 'package:tmail_ui_user/features/server_settings/domain/usecases/get_server_setting_interactor.dart';
|
||||
import 'package:tmail_ui_user/features/upload/domain/exceptions/pick_file_exception.dart';
|
||||
import 'package:tmail_ui_user/features/upload/domain/extensions/list_file_info_extension.dart';
|
||||
import 'package:tmail_ui_user/features/upload/domain/extensions/file_info_extension.dart';
|
||||
@@ -148,7 +149,7 @@ class ComposerController extends BaseController
|
||||
final SaveComposerCacheOnWebInteractor _saveComposerCacheOnWebInteractor;
|
||||
final DownloadImageAsBase64Interactor _downloadImageAsBase64Interactor;
|
||||
final TransformHtmlEmailContentInteractor _transformHtmlEmailContentInteractor;
|
||||
final GetAlwaysReadReceiptSettingInteractor _getAlwaysReadReceiptSettingInteractor;
|
||||
final GetServerSettingInteractor _getServerSettingInteractor;
|
||||
final CreateNewAndSendEmailInteractor _createNewAndSendEmailInteractor;
|
||||
final CreateNewAndSaveEmailToDraftsInteractor _createNewAndSaveEmailToDraftsInteractor;
|
||||
final PrintEmailInteractor printEmailInteractor;
|
||||
@@ -240,7 +241,7 @@ class ComposerController extends BaseController
|
||||
this._saveComposerCacheOnWebInteractor,
|
||||
this._downloadImageAsBase64Interactor,
|
||||
this._transformHtmlEmailContentInteractor,
|
||||
this._getAlwaysReadReceiptSettingInteractor,
|
||||
this._getServerSettingInteractor,
|
||||
this._createNewAndSendEmailInteractor,
|
||||
this._createNewAndSaveEmailToDraftsInteractor,
|
||||
this.printEmailInteractor,
|
||||
@@ -367,8 +368,8 @@ class ComposerController extends BaseController
|
||||
richTextMobileTabletController?.insertImage(inlineImage);
|
||||
}
|
||||
maxWithEditor = null;
|
||||
} else if (success is GetAlwaysReadReceiptSettingSuccess) {
|
||||
hasRequestReadReceipt.value = success.alwaysReadReceiptEnabled;
|
||||
} else if (success is GetServerSettingSuccess) {
|
||||
hasRequestReadReceipt.value = success.settingOption.isAlwaysReadReceipts;
|
||||
_initEmailDraftHash();
|
||||
} else if (success is RestoreEmailInlineImagesSuccess) {
|
||||
_updateEditorContent(success);
|
||||
@@ -396,7 +397,7 @@ class ComposerController extends BaseController
|
||||
if (identitySelected.value == null) {
|
||||
_autoFocusFieldWhenLauncher();
|
||||
}
|
||||
} else if (failure is GetAlwaysReadReceiptSettingFailure) {
|
||||
} else if (failure is GetServerSettingFailure) {
|
||||
hasRequestReadReceipt.value = false;
|
||||
_initEmailDraftHash();
|
||||
}
|
||||
@@ -772,7 +773,7 @@ class ComposerController extends BaseController
|
||||
log('ComposerController::_initEmail: hasRequestReadReceipt = ${arguments.hasRequestReadReceipt}');
|
||||
hasRequestReadReceipt.value = arguments.hasRequestReadReceipt ?? false;
|
||||
} else if (composerArguments.value?.emailActionType != EmailActionType.editDraft) {
|
||||
_getAlwaysReadReceiptSetting();
|
||||
_getServerSetting();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2242,11 +2243,10 @@ class ComposerController extends BaseController
|
||||
);
|
||||
}
|
||||
|
||||
void _getAlwaysReadReceiptSetting() {
|
||||
log('ComposerController::_getAlwaysReadReceiptSetting:');
|
||||
void _getServerSetting() {
|
||||
final accountId = mailboxDashBoardController.accountId.value;
|
||||
if (accountId != null) {
|
||||
consumeState(_getAlwaysReadReceiptSettingInteractor.execute(accountId));
|
||||
consumeState(_getServerSettingInteractor.execute(accountId));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2447,7 +2447,7 @@ class ComposerController extends BaseController
|
||||
void _handleGetEmailContentFailure(GetEmailContentFailure failure) {
|
||||
emailContentsViewState.value = Left(failure);
|
||||
if (composerArguments.value?.emailActionType == EmailActionType.editDraft) {
|
||||
_getAlwaysReadReceiptSetting();
|
||||
_getServerSetting();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2456,7 +2456,7 @@ class ComposerController extends BaseController
|
||||
hasRequestReadReceipt.value = true;
|
||||
_initEmailDraftHash();
|
||||
} else {
|
||||
_getAlwaysReadReceiptSetting();
|
||||
_getServerSetting();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user