TF-2859 Add language when reply calendar invitation

This commit is contained in:
DatDang
2024-05-17 14:44:36 +07:00
committed by Dat H. Pham
parent c2979429cf
commit 2e68e7df7d
10 changed files with 161 additions and 36 deletions
@@ -9,9 +9,18 @@ import 'package:jmap_dart_client/jmap/mail/calendar/reply/calendar_event_reject_
abstract class CalendarEventRepository {
Future<List<BlobCalendarEvent>> parse(AccountId accountId, Set<Id> blobIds);
Future<CalendarEventAcceptResponse> acceptEventInvitation(AccountId accountId, Set<Id> blobIds);
Future<CalendarEventAcceptResponse> acceptEventInvitation(
AccountId accountId,
Set<Id> blobIds,
String? language);
Future<CalendarEventMaybeResponse> maybeEventInvitation(AccountId accountId, Set<Id> blobIds);
Future<CalendarEventMaybeResponse> maybeEventInvitation(
AccountId accountId,
Set<Id> blobIds,
String? language);
Future<CalendarEventRejectResponse> rejectEventInvitation(AccountId accountId, Set<Id> blobIds);
Future<CalendarEventRejectResponse> rejectEventInvitation(
AccountId accountId,
Set<Id> blobIds,
String? language);
}
@@ -16,10 +16,12 @@ class AcceptCalendarEventInteractor {
AccountId accountId,
Set<Id> blobIds,
EmailId emailId,
String? language
) async* {
try {
yield Right(CalendarEventAccepting());
final result = await _calendarEventRepository.acceptEventInvitation(accountId, blobIds);
final result = await _calendarEventRepository
.acceptEventInvitation(accountId, blobIds, language);
yield Right(CalendarEventAccepted(result, emailId));
} catch (e) {
yield Left(CalendarEventAcceptFailure(exception: e));
@@ -16,10 +16,12 @@ class RejectCalendarEventInteractor {
AccountId accountId,
Set<Id> blobIds,
EmailId emailId,
String? language
) async* {
try {
yield Right(CalendarEventRejecting());
final result = await _calendarEventRepository.rejectEventInvitation(accountId, blobIds);
final result = await _calendarEventRepository
.rejectEventInvitation(accountId, blobIds, language);
yield Right(CalendarEventRejected(result, emailId));
} catch (e) {
yield Left(CalendarEventRejectFailure(exception: e));
@@ -16,10 +16,12 @@ class MaybeCalendarEventInteractor {
AccountId accountId,
Set<Id> blobIds,
EmailId emailId,
String? language
) async* {
try {
yield Right(CalendarEventMaybeReplying());
final result = await _calendarEventRepository.maybeEventInvitation(accountId, blobIds);
final result = await _calendarEventRepository
.maybeEventInvitation(accountId, blobIds, language);
yield Right(CalendarEventMaybeSuccess(result, emailId));
} catch (e) {
yield Left(CalendarEventMaybeFailure(exception: e));