Get spam mailbox cache by AccountId
(cherry picked from commit c35685bf34f5f4fbf28c4cbca9842c20dee61ffc)
This commit is contained in:
@@ -28,5 +28,5 @@ abstract class SpamReportDataSource {
|
||||
|
||||
Future<void> deleteSpamReportState();
|
||||
|
||||
Future<Mailbox> getSpamMailboxCached();
|
||||
Future<Mailbox> getSpamMailboxCached(AccountId accountId);
|
||||
}
|
||||
+1
-1
@@ -70,7 +70,7 @@ class SharePreferenceSpamReportDataSourceImpl extends SpamReportDataSource {
|
||||
}
|
||||
|
||||
@override
|
||||
Future<Mailbox> getSpamMailboxCached() {
|
||||
Future<Mailbox> getSpamMailboxCached(AccountId accountId) {
|
||||
throw UnimplementedError();
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -37,9 +37,9 @@ class SpamReportCacheDataSourceImpl extends SpamReportDataSource {
|
||||
}
|
||||
|
||||
@override
|
||||
Future<Mailbox> getSpamMailboxCached() {
|
||||
Future<Mailbox> getSpamMailboxCached(AccountId accountId) {
|
||||
return Future.sync(() async {
|
||||
return await _mailboxCacheManager.getSpamMailbox();
|
||||
return await _mailboxCacheManager.getSpamMailbox(accountId);
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -66,7 +66,7 @@ class SpamReportDataSourceImpl extends SpamReportDataSource {
|
||||
}
|
||||
|
||||
@override
|
||||
Future<Mailbox> getSpamMailboxCached() {
|
||||
Future<Mailbox> getSpamMailboxCached(AccountId accountId) {
|
||||
throw UnimplementedError();
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -62,7 +62,7 @@ class SharePreferenceSpamReportDataSource extends SpamReportDataSource {
|
||||
}
|
||||
|
||||
@override
|
||||
Future<Mailbox> getSpamMailboxCached() {
|
||||
Future<Mailbox> getSpamMailboxCached(AccountId accountId) {
|
||||
throw UnimplementedError();
|
||||
}
|
||||
}
|
||||
@@ -61,7 +61,7 @@ class SpamReportRepositoryImpl extends SpamReportRepository {
|
||||
}
|
||||
|
||||
@override
|
||||
Future<Mailbox> getSpamMailboxCached() {
|
||||
return mapDataSource[DataSourceType.cache]!.getSpamMailboxCached();
|
||||
Future<Mailbox> getSpamMailboxCached(AccountId accountId) {
|
||||
return mapDataSource[DataSourceType.cache]!.getSpamMailboxCached(accountId);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user