Skip to content

Commit

Permalink
sepinf-inc#2286: prevUfedId is not necessary - the reference is copie…
Browse files Browse the repository at this point in the history
…d in linkedItems
  • Loading branch information
aberenguel committed Aug 17, 2024
1 parent ce4898f commit 1df781f
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,6 @@ private class XMLContentHandler implements ContentHandler {
Object ignoreItemTree = null;
boolean inChat = false;
int numAttachments = 0;
String prevUfedId = null;

private class XmlNode {
String element;
Expand Down Expand Up @@ -859,13 +858,13 @@ else if (item != null && !value.isEmpty()) {
createEmailPreview(item);

} else if ("Attachment".equals(type)) { //$NON-NLS-1$
prevUfedId = handleAttachment(item);
boolean wasFileSeen = handleAttachment(item);
IItem parentItem = itemSeq.get(itemSeq.size() - 1);
if (parentItem.getMediaType().equals(MediaTypes.UFED_EMAIL_MIME)) // $NON-NLS-1$
parentItem.getMetadata().add(EMAIL_ATTACH_KEY, item.getName());
else if (parentItem.getMediaType().equals(MediaTypes.UFED_MESSAGE_MIME)) {
this.numAttachments++;
if (prevUfedId != null) {
if (wasFileSeen) {
seenAttachment = true;
List<Item> attachs = seenAttachsPerId.get(item.getParentId());
if (attachs == null) {
Expand Down Expand Up @@ -1121,9 +1120,9 @@ else if ("Participants".equalsIgnoreCase(role)) {
if (!ignoreItems) {
// Process seen attachments later. Process other item types now.
if (!seenAttachment) {
String ufedId = item.getMetadata().get(ExtraProperties.UFED_META_PREFIX + "id");
// add items if not ignoring already added instant message xml tree
if (ignoreItemTree == null) {
String ufedId = item.getMetadata().get(ExtraProperties.UFED_META_PREFIX + "id");
if ("InstantMessage".equals(type)) {
if (itemSeq.isEmpty()) {
// process messages without chat
Expand Down Expand Up @@ -1466,7 +1465,7 @@ private void updateName(IItem item, String newName) {
item.setName(newName);
}

private String handleAttachment(Item item) {
private boolean handleAttachment(Item item) {
String name = item.getMetadata().get(ExtraProperties.UFED_META_PREFIX + "Filename"); //$NON-NLS-1$
if (name != null)
updateName(item, name);
Expand Down Expand Up @@ -1517,7 +1516,7 @@ private String handleAttachment(Item item) {
}
}

return fileId;
return fileId != null;
}

private String normalizePaths(String path) {
Expand Down

0 comments on commit 1df781f

Please sign in to comment.