diff --git a/iped-parsers/iped-parsers-impl/src/main/java/iped/parsers/whatsapp/Message.java b/iped-parsers/iped-parsers-impl/src/main/java/iped/parsers/whatsapp/Message.java index f9fae1a459..7feb40419f 100644 --- a/iped-parsers/iped-parsers-impl/src/main/java/iped/parsers/whatsapp/Message.java +++ b/iped-parsers/iped-parsers-impl/src/main/java/iped/parsers/whatsapp/Message.java @@ -637,7 +637,7 @@ public void setMessageTemplate(MessageTemplate messageTemplate) { } public long getSortId() { - return sortId; + return sortId != 0 ? sortId : timeStamp != null ? timeStamp.getTime() : id; } public void setSortId(long sortId) { @@ -690,18 +690,6 @@ public static enum MessageQuotedType { @Override public int compareTo(Message o) { - if (getSortId() != 0 && o.getSortId() != 0) { - int comp = Long.compare(getSortId(), o.getSortId()); - if (comp != 0) { - return comp; - } - } - if (getTimeStamp() != null && o.getTimeStamp() != null) { - int comp = getTimeStamp().compareTo(o.getTimeStamp()); - if (comp != 0) { - return comp; - } - } - return Long.compare(getId(), o.getId()); + return Long.compare(getSortId(), o.getSortId()); } }