diff --git a/iped-parsers/iped-parsers-impl/src/main/java/iped/parsers/whatsapp/WhatsAppParser.java b/iped-parsers/iped-parsers-impl/src/main/java/iped/parsers/whatsapp/WhatsAppParser.java index 7f2b987643..d953f0bc35 100644 --- a/iped-parsers/iped-parsers-impl/src/main/java/iped/parsers/whatsapp/WhatsAppParser.java +++ b/iped-parsers/iped-parsers-impl/src/main/java/iped/parsers/whatsapp/WhatsAppParser.java @@ -344,6 +344,14 @@ private void createReport(List 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;