TF-1311 Add capability of Team-Mailbox for GetMailboxMethod

This commit is contained in:
dab246
2023-02-08 15:51:49 +07:00
committed by Dat Vu
parent b2af558790
commit 9a46f7f865
9 changed files with 23 additions and 19 deletions
@@ -51,7 +51,7 @@ class MailboxRepositoryImpl extends MailboxRepository {
State? sinceState = localMailboxResponse.state!;
while(hasMoreChanges && sinceState != null) {
final changesResponse = await mapDataSource[DataSourceType.network]!.getChanges(accountId, sinceState);
final changesResponse = await mapDataSource[DataSourceType.network]!.getChanges(session, accountId, sinceState);
hasMoreChanges = changesResponse.hasMoreChanges;
sinceState = changesResponse.newStateChanges;
@@ -115,14 +115,14 @@ class MailboxRepositoryImpl extends MailboxRepository {
}
@override
Stream<MailboxResponse> refresh(AccountId accountId, State currentState) async* {
Stream<MailboxResponse> refresh(Session session, AccountId accountId, State currentState) async* {
final localMailboxList = await mapDataSource[DataSourceType.local]!.getAllMailboxCache();
bool hasMoreChanges = true;
State? sinceState = currentState;
while(hasMoreChanges && sinceState != null) {
final changesResponse = await mapDataSource[DataSourceType.network]!.getChanges(accountId, sinceState);
final changesResponse = await mapDataSource[DataSourceType.network]!.getChanges(session, accountId, sinceState);
hasMoreChanges = changesResponse.hasMoreChanges;
sinceState = changesResponse.newStateChanges;