TF-2536 Change the logic to get all mailbox

Signed-off-by: dab246 <tdvu@linagora.com>
This commit is contained in:
dab246
2024-02-05 16:16:40 +07:00
committed by Dat PHAM HOANG
parent 560bba622c
commit d8bfb83e89
19 changed files with 273 additions and 115 deletions
@@ -60,7 +60,8 @@ class NewEmailCacheManager {
}
Future<List<DetailedEmailHiveCache>> getAllDetailedEmails(AccountId accountId, UserName userName) async {
final detailedEmailCacheList = await _cacheClient.getListByTupleKey(accountId.asString, userName.value);
final nestedKey = TupleKey(accountId.asString, userName.value).encodeKey;
final detailedEmailCacheList = await _cacheClient.getListByNestedKey(nestedKey);
detailedEmailCacheList.sortByLatestTime();
return detailedEmailCacheList;
}
@@ -40,7 +40,8 @@ class OpenedEmailCacheManager {
}
Future<List<DetailedEmailHiveCache>> getAllDetailedEmails(AccountId accountId, UserName userName) async {
final detailedEmailCacheList = await _cacheClient.getListByTupleKey(accountId.asString, userName.value);
final nestedKey = TupleKey(accountId.asString, userName.value).encodeKey;
final detailedEmailCacheList = await _cacheClient.getListByNestedKey(nestedKey);
detailedEmailCacheList.sortByLatestTime();
log('OpenedEmailCacheManager::getAllDetailedEmails():SIZE: ${detailedEmailCacheList.length}');
return detailedEmailCacheList;
@@ -30,7 +30,8 @@ class SendingEmailCacheManager {
}
Future<List<SendingEmailHiveCache>> getAllSendingEmailsByTupleKey(AccountId accountId, UserName userName) async {
final sendingEmailsCache = await _hiveCacheClient.getListByTupleKey(accountId.asString, userName.value);
final nestedKey = TupleKey(accountId.asString, userName.value).encodeKey;
final sendingEmailsCache = await _hiveCacheClient.getListByNestedKey(nestedKey);
sendingEmailsCache.sortByLatestTime();
return sendingEmailsCache;
}