Skip to content

Commit

Permalink
'#2264: ignore original messages of reply msgs being duplicated in case
Browse files Browse the repository at this point in the history
  • Loading branch information
lfcnassif committed Jul 27, 2024
1 parent 0ab4e06 commit c2d9109
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -896,6 +896,7 @@ else if (parentItem.getMediaType().equals(MediaTypes.UFED_MESSAGE_MIME)) {
item.getMetadata().set(ExtraProperties.MESSAGE_BODY, body);
}
int numInstantMsgAttachs = 0;
boolean ignoreItemLocal = false;
if ("InstantMessage".equals(type)) {
numInstantMsgAttachs = this.numAttachments;
if (numInstantMsgAttachs > 0) {
Expand All @@ -904,6 +905,13 @@ else if (parentItem.getMediaType().equals(MediaTypes.UFED_MESSAGE_MIME)) {
UFEDChatParser.ATTACHED_MEDIA_MSG + numInstantMsgAttachs);
}
this.numAttachments = 0;
if (!itemSeq.isEmpty()) {
IItem parentItem = itemSeq.get(itemSeq.size() - 1);
// See https://github.com/sepinf-inc/IPED/issues/2264#issuecomment-2254192462
if (parentItem.getName().startsWith("ReplyMessageData_")) {
ignoreItemLocal = true;
}
}
}
if (mergeInParentNode.contains(type) && itemSeq.size() > 0) {
IItem parentItem = itemSeq.get(itemSeq.size() - 1);
Expand Down Expand Up @@ -1067,7 +1075,11 @@ else if ("Bcc".equalsIgnoreCase(role)) //$NON-NLS-1$
String ufedId = item.getMetadata().get(ExtraProperties.UFED_META_PREFIX + "id");
// add items if not ignoring already added instant message xml tree
if (ignoreItemTree == null) {
processItem(item);
if (!ignoreItemLocal) {
processItem(item);
} else {
caseData.incDiscoveredEvidences(-1);
}
if ("InstantMessage".equals(type)) {
// remember IM ids to not add them again later
addedImUfedIds.add(ufedId);
Expand Down

0 comments on commit c2d9109

Please sign in to comment.