Skip to content

Commit

Permalink
Merge branch 'master' into #2294_user_account_register_xml
Browse files Browse the repository at this point in the history
  • Loading branch information
wladimirleite committed Oct 15, 2024
2 parents ca1d4f5 + 474f4b9 commit b0470a2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1436,6 +1436,11 @@ private String handleAttachment(Item item) {
// Replace extracted path by attached file's local path
extracted_path = ufedFileIdToLocalPath.get(item.getMetadata().get(FILE_ID_ATTR));
}

// if extracted_path does not reference a ufedId, use the ufedId of attached file
if (ufedId == null && ufedFileIdToLocalPath.containsKey(item.getMetadata().get(FILE_ID_ATTR))) {
ufedId = item.getMetadata().get(FILE_ID_ATTR);
}

}
setContent(item, extracted_path);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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());
}
}

0 comments on commit b0470a2

Please sign in to comment.