TF-1710 Add empty spam folder interactor
(cherry picked from commit f0d22cd8925185607b5dea74f2cf40052980d19c)
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
|
||||
import 'package:core/core.dart';
|
||||
import 'package:core/data/model/source_type/data_source_type.dart';
|
||||
import 'package:core/utils/app_logger.dart';
|
||||
import 'package:dartz/dartz.dart' as dartz;
|
||||
import 'package:jmap_dart_client/jmap/account_id.dart';
|
||||
import 'package:jmap_dart_client/jmap/core/filter/filter.dart';
|
||||
@@ -300,7 +301,7 @@ class ThreadRepositoryImpl extends ThreadRepository {
|
||||
|
||||
@override
|
||||
Future<List<EmailId>> emptyTrashFolder(Session session, AccountId accountId, MailboxId trashMailboxId) async {
|
||||
return mapDataSource[DataSourceType.network]!.emptyTrashFolder(
|
||||
return mapDataSource[DataSourceType.network]!.emptyMailboxFolder(
|
||||
session,
|
||||
accountId,
|
||||
trashMailboxId,
|
||||
@@ -377,4 +378,20 @@ class ThreadRepositoryImpl extends ThreadRepository {
|
||||
) {
|
||||
return mapDataSource[DataSourceType.network]!.getEmailById(session, accountId, emailId, properties: properties);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<List<EmailId>> emptySpamFolder(Session session, AccountId accountId, MailboxId spamMailboxId) {
|
||||
return mapDataSource[DataSourceType.network]!.emptyMailboxFolder(
|
||||
session,
|
||||
accountId,
|
||||
spamMailboxId,
|
||||
(listEmailIdDeleted) async {
|
||||
await _updateEmailCache(
|
||||
accountId,
|
||||
session.username,
|
||||
newDestroyed: listEmailIdDeleted
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user