mirror of
https://github.com/markqvist/NomadNet.git
synced 2026-11-19 14:36:28 -05:00
Prepared announce filtering
This commit is contained in:
parent
1f477ca8cf
commit
22cd7ceff3
3 changed files with 15 additions and 1 deletions
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue