mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-12 07:56:16 +00:00
writeAllHitsToBlackBoard() can now optionally make calls to writeInboxMessage()
This commit is contained in:
parent
1dd46a1ee8
commit
f6634fbd3b
@ -98,9 +98,10 @@ class QueryResults {
|
||||
* @param query
|
||||
* @param listName
|
||||
* @param progress
|
||||
* @param notifyInbox flag indicating whether or not to call writeInboxMessage() for each hit
|
||||
* @return list of new artifacts
|
||||
*/
|
||||
public Collection<BlackboardArtifact> writeAllHitsToBlackBoard(KeywordSearchQuery query, String listName, ProgressHandle progress) {
|
||||
public Collection<BlackboardArtifact> writeAllHitsToBlackBoard(KeywordSearchQuery query, String listName, ProgressHandle progress, boolean notifyInbox) {
|
||||
final Collection<BlackboardArtifact> newArtifacts = new ArrayList<>();
|
||||
|
||||
progress.start(getKeywords().size());
|
||||
@ -131,6 +132,9 @@ class QueryResults {
|
||||
KeywordWriteResult written = query.writeToBlackBoard(hit.toString(), hitFile, snippet, listName);
|
||||
if (written != null) {
|
||||
newArtifacts.add(written.getArtifact());
|
||||
if (notifyInbox) {
|
||||
writeInboxMessage(query, written, hitFile);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -147,8 +151,7 @@ class QueryResults {
|
||||
/**
|
||||
* Generate an ingest inbox message for this keyword in this file
|
||||
*/
|
||||
public void writeInboxMessage(KeywordSearchQuery query, KeywordList list, KeywordWriteResult written, AbstractFile hitFile) {
|
||||
if (list.getIngestMessages()) {
|
||||
public void writeInboxMessage(KeywordSearchQuery query, KeywordWriteResult written, AbstractFile hitFile) {
|
||||
StringBuilder subjectSb = new StringBuilder();
|
||||
StringBuilder detailsSb = new StringBuilder();
|
||||
|
||||
@ -209,6 +212,5 @@ class QueryResults {
|
||||
|
||||
IngestServices.getInstance().postMessage(IngestMessage.createDataMessage(KeywordSearchModuleFactory.getModuleName(), subjectSb.toString(), detailsSb.toString(), uniqueKey, written.getArtifact()));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -524,8 +524,11 @@ public final class SearchRunner {
|
||||
|
||||
newArtifacts.add(written.getArtifact());
|
||||
|
||||
// inbox
|
||||
newResults.writeInboxMessage(keywordSearchQuery, list, written, hitFile);
|
||||
// Inbox messages
|
||||
boolean notifyInbox = list.getIngestMessages();
|
||||
if (notifyInbox) {
|
||||
newResults.writeInboxMessage(keywordSearchQuery, written, hitFile);
|
||||
}
|
||||
|
||||
} //for each file hit
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user