From 16deaf18c73cb6973d5195c8464757b0b77e3f15 Mon Sep 17 00:00:00 2001 From: Adrian Maraj Date: Mon, 8 Apr 2024 16:12:56 +0200 Subject: [PATCH] changing get_filtered_emails --- lookyloo/lookyloo.py | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/lookyloo/lookyloo.py b/lookyloo/lookyloo.py index c59ef9ee..44f9a75b 100644 --- a/lookyloo/lookyloo.py +++ b/lookyloo/lookyloo.py @@ -803,15 +803,10 @@ class Lookyloo(): def get_filtered_emails(self, capture_uuid, detailed=False) -> set[str] | dict[str, str]: info = self.contacts(capture_uuid) - if detailed: #emails in a dict with their hostname as key - final_mails = {} - for i in info: - final_mails[i['hostname']] = i['all_emails'] - else: #just all emails together - final_mails = set() - for i in info: - for mail in i['all_emails']: - final_mails.add(mail) + final_mails = set() + for i in info: + for mail in i['all_emails']: + final_mails.add(mail) return final_mails def contacts(self, capture_uuid: str, /) -> list[dict[str, Any]]: @@ -819,8 +814,8 @@ class Lookyloo(): rendered_hostnode = self.get_hostnode_from_tree(capture_uuid, capture.root_hartree.rendered_node.hostnode_uuid) result = [] for node in reversed(rendered_hostnode.get_ancestors()): - result.append(self.takedown_filtered(node)) - result.append(self.takedown_filtered(rendered_hostnode)) + result.append(self.takedown_details(node)) + result.append(self.takedown_details(rendered_hostnode)) return result def send_mail(self, capture_uuid: str, /, email: str='', comment: str | None=None) -> bool | dict[str, Any]: