diff --git a/iped-parsers/iped-parsers-impl/src/main/java/iped/parsers/whatsapp/Chat.java b/iped-parsers/iped-parsers-impl/src/main/java/iped/parsers/whatsapp/Chat.java index 790c6df3d3..541560e623 100644 --- a/iped-parsers/iped-parsers-impl/src/main/java/iped/parsers/whatsapp/Chat.java +++ b/iped-parsers/iped-parsers-impl/src/main/java/iped/parsers/whatsapp/Chat.java @@ -97,9 +97,13 @@ public String getTitle() { } } else { title = "WhatsApp Chat"; //$NON-NLS-1$ - if (remote != null && remote.getName() != null - && (getPrintId() == null || !remote.getName().strip().equals(getPrintId().strip()))) + if (remote != null && remote.getDisplayName() != null && !remote.getDisplayName().isBlank() + && (getPrintId() == null || !remote.getDisplayName().strip().equals(getPrintId().strip()))) { + title += " - " + remote.getDisplayName().strip(); + } else if (remote != null && remote.getName() != null + && (getPrintId() == null || !remote.getName().strip().equals(getPrintId().strip()))) { title += " - " + remote.getName().strip(); //$NON-NLS-1$ + } } if (getPrintId() != null && !getPrintId().isBlank()) { title += " - " + getPrintId().strip(); diff --git a/iped-parsers/iped-parsers-impl/src/main/java/iped/parsers/whatsapp/ReportGenerator.java b/iped-parsers/iped-parsers-impl/src/main/java/iped/parsers/whatsapp/ReportGenerator.java index 7b225f04af..9e2abeee40 100644 --- a/iped-parsers/iped-parsers-impl/src/main/java/iped/parsers/whatsapp/ReportGenerator.java +++ b/iped-parsers/iped-parsers-impl/src/main/java/iped/parsers/whatsapp/ReportGenerator.java @@ -1069,7 +1069,10 @@ private String getBestContactName(boolean isFromMe, String remoteResource, WACon if (number != null) { WAContact contact = contactsDirectory.getContact(number); if (contact != null) { - name = contact.getName(); + name = contact.getDisplayName(); + if (name == null || name.isBlank()) { + name = contact.getName(); + } } if (number.endsWith(waSuffix)) { number = number.substring(0, number.length() - waSuffix.length());