From 85c764eaaca4a1983ee95a4a535d149e21111fcf Mon Sep 17 00:00:00 2001 From: Ann Priestman Date: Wed, 26 Jun 2019 13:48:52 -0400 Subject: [PATCH 1/2] Put call logs under a call log node instead of unthreaded --- .../relationships/Bundle.properties-MERGED | 1 + .../relationships/MessageNode.java | 8 ++- .../relationships/MessageViewer.java | 9 +++- .../MessagesChildNodeFactory.java | 10 +++- .../relationships/ThreadChildNodeFactory.java | 49 +++++++++++++++++-- .../relationships/ThreadNode.java | 2 +- 6 files changed, 68 insertions(+), 11 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/communications/relationships/Bundle.properties-MERGED b/Core/src/org/sleuthkit/autopsy/communications/relationships/Bundle.properties-MERGED index 75c26378b3..1e7860b941 100755 --- a/Core/src/org/sleuthkit/autopsy/communications/relationships/Bundle.properties-MERGED +++ b/Core/src/org/sleuthkit/autopsy/communications/relationships/Bundle.properties-MERGED @@ -27,6 +27,7 @@ MessageViewer_columnHeader_To=To MessageViewer_no_messages= MessageViewer_tabTitle=Messages MessageViewer_viewMessage_all=All +MessageViewer_viewMessage_calllogs=Call Logs MessageViewer_viewMessage_selected=Selected MessageViewer_viewMessage_unthreaded=Unthreaded SummaryViewer.countsPanel.border.title=Counts diff --git a/Core/src/org/sleuthkit/autopsy/communications/relationships/MessageNode.java b/Core/src/org/sleuthkit/autopsy/communications/relationships/MessageNode.java index cc67e10fbd..d34bc084da 100755 --- a/Core/src/org/sleuthkit/autopsy/communications/relationships/MessageNode.java +++ b/Core/src/org/sleuthkit/autopsy/communications/relationships/MessageNode.java @@ -48,6 +48,7 @@ import org.sleuthkit.autopsy.datamodel.BlackboardArtifactNode; class MessageNode extends BlackboardArtifactNode { public static final String UNTHREADED_ID = ""; + public static final String CALL_LOG_ID = ""; private static final Logger logger = Logger.getLogger(MessageNode.class.getName()); @@ -87,9 +88,14 @@ class MessageNode extends BlackboardArtifactNode { sheetSet.put(new NodeProperty<>("Type", Bundle.MessageNode_Node_Property_Type(), "", getDisplayName())); //NON-NLS - sheetSet.put(new NodeProperty<>("ThreadID", "ThreadID","",threadID == null ? UNTHREADED_ID : threadID)); //NON-NLS + final BlackboardArtifact artifact = getArtifact(); + if (artifact.getArtifactTypeID() == BlackboardArtifact.ARTIFACT_TYPE.TSK_CALLLOG.getTypeID()) { + sheetSet.put(new NodeProperty<>("ThreadID", "ThreadID","",CALL_LOG_ID)); //NON-NLS + } else { + sheetSet.put(new NodeProperty<>("ThreadID", "ThreadID","",threadID == null ? UNTHREADED_ID : threadID)); //NON-NLS + } BlackboardArtifact.ARTIFACT_TYPE fromID = BlackboardArtifact.ARTIFACT_TYPE.fromID(artifact.getArtifactTypeID()); if (null != fromID) { diff --git a/Core/src/org/sleuthkit/autopsy/communications/relationships/MessageViewer.java b/Core/src/org/sleuthkit/autopsy/communications/relationships/MessageViewer.java index ad8d5eb7b3..4c7be60e80 100755 --- a/Core/src/org/sleuthkit/autopsy/communications/relationships/MessageViewer.java +++ b/Core/src/org/sleuthkit/autopsy/communications/relationships/MessageViewer.java @@ -82,7 +82,8 @@ public class MessageViewer extends JPanel implements RelationshipsViewer { "MessageViewer_no_messages=", "MessageViewer_viewMessage_all=All", "MessageViewer_viewMessage_selected=Selected", - "MessageViewer_viewMessage_unthreaded=Unthreaded",}) + "MessageViewer_viewMessage_unthreaded=Unthreaded", + "MessageViewer_viewMessage_calllogs=Call Logs"}) /** * Creates new form MessageViewer @@ -228,7 +229,11 @@ public class MessageViewer extends JPanel implements RelationshipsViewer { if (!subject.isEmpty()) { threadNameLabel.setText(subject); } else { - threadNameLabel.setText(Bundle.MessageViewer_viewMessage_unthreaded()); + if (threadIDList.contains(MessageNode.CALL_LOG_ID)) { + threadNameLabel.setText(Bundle.MessageViewer_viewMessage_calllogs()); + } else { + threadNameLabel.setText(Bundle.MessageViewer_viewMessage_unthreaded()); + } } showMessagesPane(); diff --git a/Core/src/org/sleuthkit/autopsy/communications/relationships/MessagesChildNodeFactory.java b/Core/src/org/sleuthkit/autopsy/communications/relationships/MessagesChildNodeFactory.java index 726fba4341..a9462bf444 100755 --- a/Core/src/org/sleuthkit/autopsy/communications/relationships/MessagesChildNodeFactory.java +++ b/Core/src/org/sleuthkit/autopsy/communications/relationships/MessagesChildNodeFactory.java @@ -102,10 +102,16 @@ public class MessagesChildNodeFactory extends ChildFactory{ continue; } - // We want all artifacts that do not have "threadIDs" to appear as one thread in the UI + // We want email and message artifacts that do not have "threadIDs" to appear as one thread in the UI // To achive this assign any artifact that does not have a threadID // the "UNTHREADED_ID" - String artifactThreadID = MessageNode.UNTHREADED_ID; + // All call logs will default to a single call logs thread + String artifactThreadID; + if (fromID == BlackboardArtifact.ARTIFACT_TYPE.TSK_CALLLOG) { + artifactThreadID = MessageNode.CALL_LOG_ID; + } else { + artifactThreadID = MessageNode.UNTHREADED_ID; + } BlackboardAttribute attribute = bba.getAttribute(new BlackboardAttribute.Type(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_THREAD_ID)); if(attribute != null) { diff --git a/Core/src/org/sleuthkit/autopsy/communications/relationships/ThreadChildNodeFactory.java b/Core/src/org/sleuthkit/autopsy/communications/relationships/ThreadChildNodeFactory.java index 8c4f8b40de..3258a64cc0 100755 --- a/Core/src/org/sleuthkit/autopsy/communications/relationships/ThreadChildNodeFactory.java +++ b/Core/src/org/sleuthkit/autopsy/communications/relationships/ThreadChildNodeFactory.java @@ -133,10 +133,16 @@ final class ThreadChildNodeFactory extends ChildFactory { || fromID == BlackboardArtifact.ARTIFACT_TYPE.TSK_CALLLOG || fromID == BlackboardArtifact.ARTIFACT_TYPE.TSK_MESSAGE) { - // We want all artifacts that do not have "threadIDs" to appear as one thread in the UI + // We want email and message artifacts that do not have "threadIDs" to appear as one thread in the UI // To achive this assign any artifact that does not have a threadID // the "UNTHREADED_ID" - String threadID = MessageNode.UNTHREADED_ID; + // All call logs will default to a single call logs thread + String threadID; + if (fromID == BlackboardArtifact.ARTIFACT_TYPE.TSK_CALLLOG) { + threadID = MessageNode.CALL_LOG_ID; + } else { + threadID = MessageNode.UNTHREADED_ID; + } BlackboardAttribute attribute = bba.getAttribute(new BlackboardAttribute.Type(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_THREAD_ID)); if(attribute != null) { @@ -180,13 +186,46 @@ final class ThreadChildNodeFactory extends ChildFactory { if (attribute != null) { return new ThreadNode(bba, attribute.getValueString(), preferredAction); } else { - // Only one of these should occur. - return new UnthreadedNode(); + if (bba.getArtifactTypeID() == BlackboardArtifact.ARTIFACT_TYPE.TSK_CALLLOG.getTypeID()) { + return new CallLogNode(); + } else { + // Only one of these should occur. + return new UnthreadedNode(); + } } } /** - * An this node represents the "unthreaded" thread. + * This node represents the "call log" thread. + */ + final class CallLogNode extends AbstractNode { + /** + * Construct an instance of a CallLogNode. + */ + CallLogNode() { + super(Children.LEAF); + setDisplayName("Call Logs"); + this.setIconBaseWithExtension("org/sleuthkit/autopsy/communications/images/unthreaded.png" ); + } + + @Override + protected Sheet createSheet() { + Sheet sheet = super.createSheet(); + Sheet.Set sheetSet = sheet.get(Sheet.PROPERTIES); + if (sheetSet == null) { + sheetSet = Sheet.createPropertiesSet(); + sheet.put(sheetSet); + } + + // Give this node a threadID of "UNTHEADED_ID" + sheetSet.put(new NodeProperty<>("ThreadID", "ThreadID","",MessageNode.CALL_LOG_ID)); + + return sheet; + } + } + + /** + * This node represents the "unthreaded" thread. */ final class UnthreadedNode extends AbstractNode { /** diff --git a/Core/src/org/sleuthkit/autopsy/communications/relationships/ThreadNode.java b/Core/src/org/sleuthkit/autopsy/communications/relationships/ThreadNode.java index f398b94757..013730a097 100755 --- a/Core/src/org/sleuthkit/autopsy/communications/relationships/ThreadNode.java +++ b/Core/src/org/sleuthkit/autopsy/communications/relationships/ThreadNode.java @@ -25,7 +25,7 @@ import org.openide.nodes.Sheet; import org.sleuthkit.datamodel.BlackboardArtifact; /** - * An AbstractNode subclass which wraps a MessagNode object. Doing this allows + * An AbstractNode subclass which wraps a MessageNode object. Doing this allows * for the reuse of the createSheet and other function from MessageNode, but * also some customizing of how a ThreadNode is shown. */ From abfab92f27475c689ee44e029381f7877779bccc Mon Sep 17 00:00:00 2001 From: Ann Priestman Date: Wed, 26 Jun 2019 13:50:22 -0400 Subject: [PATCH 2/2] Fix typo --- .../communications/relationships/ThreadChildNodeFactory.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/src/org/sleuthkit/autopsy/communications/relationships/ThreadChildNodeFactory.java b/Core/src/org/sleuthkit/autopsy/communications/relationships/ThreadChildNodeFactory.java index 3258a64cc0..784cd6c185 100755 --- a/Core/src/org/sleuthkit/autopsy/communications/relationships/ThreadChildNodeFactory.java +++ b/Core/src/org/sleuthkit/autopsy/communications/relationships/ThreadChildNodeFactory.java @@ -217,7 +217,7 @@ final class ThreadChildNodeFactory extends ChildFactory { sheet.put(sheetSet); } - // Give this node a threadID of "UNTHEADED_ID" + // Give this node a threadID of "CALL_LOG_ID" sheetSet.put(new NodeProperty<>("ThreadID", "ThreadID","",MessageNode.CALL_LOG_ID)); return sheet;