TF-4069 Automatically reply should be deactivated vacation after end date
This commit is contained in:
+21
@@ -0,0 +1,21 @@
|
||||
import 'package:jmap_dart_client/jmap/mail/vacation/vacation_response.dart';
|
||||
import 'package:tmail_ui_user/features/manage_account/presentation/extensions/vacation_response_extension.dart';
|
||||
import 'package:tmail_ui_user/features/manage_account/presentation/manage_account_dashboard_controller.dart';
|
||||
|
||||
extension HandleVacationResponseExtension on ManageAccountDashBoardController {
|
||||
void syncVacationResponse(VacationResponse? newVacation) {
|
||||
if (newVacation?.vacationResponderIsStopped == true) {
|
||||
automaticallyDeactivateVacation(newVacation!);
|
||||
} else {
|
||||
setUpVacation(newVacation);
|
||||
}
|
||||
}
|
||||
|
||||
void setUpVacation(VacationResponse? newVacation) {
|
||||
vacationResponse.value = newVacation;
|
||||
}
|
||||
|
||||
void automaticallyDeactivateVacation(VacationResponse vacationResponse) {
|
||||
disableVacationResponder(vacationResponse);
|
||||
}
|
||||
}
|
||||
@@ -87,6 +87,10 @@ extension VacationResponseExtension on VacationResponse {
|
||||
htmlBody: htmlBody ?? this.htmlBody
|
||||
);
|
||||
}
|
||||
|
||||
VacationResponse clearAllExceptHtmlBody() {
|
||||
return VacationResponse(isEnabled: false, htmlBody: htmlBody);
|
||||
}
|
||||
|
||||
String getNotificationMessage(BuildContext context) {
|
||||
if (vacationResponderIsValid) {
|
||||
|
||||
Reference in New Issue
Block a user