Skip to content

Commit

Permalink
'#2406: Set created/modified dates based on first/ last messages dates.
Browse files Browse the repository at this point in the history
  • Loading branch information
wladimirleite committed Jan 11, 2025
1 parent e042995 commit fd62e0b
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,14 @@ private void createReport(List<Chat> chatList, IItemSearcher searcher, WAContact
}
}

// Set created and modified dates based on the first and last messages dates
if (!msgSubset.isEmpty()) {
Message first = msgSubset.get(0);
chatMetadata.set(TikaCoreProperties.CREATED, first.getTimeStamp());
Message last = msgSubset.get(msgSubset.size() - 1);
chatMetadata.set(TikaCoreProperties.MODIFIED, last.getTimeStamp());
}

ByteArrayInputStream chatStream = new ByteArrayInputStream(bytes);
extractor.parseEmbedded(chatStream, handler, chatMetadata, false);
bytes = nextBytes;
Expand Down

0 comments on commit fd62e0b

Please sign in to comment.