Skip to content

Commit

Permalink
'#2337: Sort before generating WA chat report.
Browse files Browse the repository at this point in the history
  • Loading branch information
wladimirleite committed Dec 24, 2024
1 parent 2389779 commit e452e02
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,9 @@ private void createReport(List<Chat> chatList, IItemSearcher searcher, WAContact
int chatVirtualId = 0;
HashMap<String, String> cache = new HashMap<>();
for (Chat c : chatList) {
// sort messages before generating the report
Message.sort(c.getMessages());

getAvatar(searcher, c.getRemote());
searchMediaFilesForMessagesInBatches(c.getMessages(), searcher, handler, extractor, dbPath, context, null);
int frag = 0;
Expand Down Expand Up @@ -735,11 +738,6 @@ public int compare(WhatsAppContext o1, WhatsAppContext o2) {
logger.info("Creating separate report for {}", DB.getPath()); //$NON-NLS-1$
}

// sort messages
for (Chat chat : dbChatList) {
Message.sort(chat.getMessages());
}

// create report for main dbs and backups which main db was not found
createReport(dbChatList, searcher, contacts, handler, extractor, account, tmpDB, context);

Expand Down

0 comments on commit e452e02

Please # to comment.