From 22cd7ceff30502e1f9f01f27c71d7e4b8b9d99d6 Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Sun, 1 Nov 2026 21:49:54 +0100 Subject: [PATCH] Prepared announce filtering --- nomadnet/NomadNetworkApp.py | 5 +++++ nomadnet/RRC.py | 3 +++ nomadnet/ui/textui/Network.py | 8 +++++++- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/nomadnet/NomadNetworkApp.py b/nomadnet/NomadNetworkApp.py index b32a4e2..e778976 100644 --- a/nomadnet/NomadNetworkApp.py +++ b/nomadnet/NomadNetworkApp.py @@ -36,6 +36,8 @@ class NomadNetworkApp: START_ANNOUNCE_DELAY = 3 + REQUIRED_DESTINATION_TYPES = ["nomadnetwork.node", "lxmf.delivery", "lxmf.propagation", "rrc.hub"] + def exit_handler(self): self.should_run_jobs = False @@ -103,6 +105,9 @@ class NomadNetworkApp: NomadNetworkApp._shared_instance = self self.rns = RNS.Reticulum(configdir = rnsconfigdir) + # self.rns.required_announces_only(True) + for full_name in self.REQUIRED_DESTINATION_TYPES: + self.rns.wants_destination_type(full_name) self.configpath = self.configdir+"/config" self.ignoredpath = self.configdir+"/ignored" diff --git a/nomadnet/RRC.py b/nomadnet/RRC.py index f5cde89..3fefcca 100644 --- a/nomadnet/RRC.py +++ b/nomadnet/RRC.py @@ -223,6 +223,9 @@ class RRCHub: self.dest_name = dest_name or DEFAULT_DEST_NAME self.name = name or RNS.prettyhexrep(hub_hash) + if not self.dest_name == DEFAULT_DEST_NAME: + RNS.Reticulum.get_instance().wants_destination_type(self.dest_name) + self.link = None self.status = RRCHub.STATUS_DISCONNECTED self.status_text = "Disconnected" diff --git a/nomadnet/ui/textui/Network.py b/nomadnet/ui/textui/Network.py index 11c4e54..cdab4a6 100644 --- a/nomadnet/ui/textui/Network.py +++ b/nomadnet/ui/textui/Network.py @@ -626,6 +626,8 @@ class KnownNodeInfo(urwid.WidgetWrap): source_hash = node_hash node_ident = RNS.Identity.recall(node_hash) + dst_value = RNS.Identity.recall_stamp_value(node_hash) + link_cost = RNS.Identity.recall_link_cost(node_hash) time_format = self.app.time_format trust_level = self.app.directory.trust_level(source_hash) trust_str = "" @@ -641,7 +643,9 @@ class KnownNodeInfo(urwid.WidgetWrap): else: display_str = strip_modifiers(node_entry.display_name) - addr_str = "<"+RNS.hexrep(source_hash, delimit=False)+">" + addr_str = "<"+RNS.hexrep(source_hash, delimit=False)+">" + dst_val_str = f"{RNS.prettycost(dst_value)}" if dst_value else "None" + link_cost_str = f"{RNS.prettycost(link_cost)}" if link_cost else "None" if display_str == None: display_str = addr_str @@ -791,6 +795,8 @@ class KnownNodeInfo(urwid.WidgetWrap): urwid.Text("Type : "+type_string, align=urwid.LEFT), e_name, urwid.Text("Node Addr : "+addr_str, align=urwid.LEFT), + urwid.Text("Link Cost : "+link_cost_str, align=urwid.LEFT), + urwid.Text("Dst Value : "+dst_val_str, align=urwid.LEFT), e_sort, urwid.Divider(g["divider1"]), urwid.Text(lxmf_addr_str, align=urwid.CENTER),