From c4b0bd0b5796d0699a5efa824e546e03958de394 Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Sat, 16 May 2026 22:58:56 +0200 Subject: [PATCH] Uuh... We didn't have periodic lxmf announces? --- nomadnet/NomadNetworkApp.py | 15 ++++++++++++++- nomadnet/ui/textui/Guide.py | 6 ++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/nomadnet/NomadNetworkApp.py b/nomadnet/NomadNetworkApp.py index b0d99e2..b40ddba 100644 --- a/nomadnet/NomadNetworkApp.py +++ b/nomadnet/NomadNetworkApp.py @@ -268,7 +268,7 @@ class NomadNetworkApp: RNS.log("No peer settings file found, creating new...") self.peer_settings = { "display_name": "Anonymous Peer", - "announce_interval": None, + "announce_interval": 6*60*60, "last_announce": None, "node_last_announce": None, "propagation_node": None, @@ -447,6 +447,9 @@ class NomadNetworkApp: RNS.log("Initiating automatic LXMF sync", RNS.LOG_VERBOSE) self.request_lxmf_sync(limit=self.lxmf_sync_limit) + if now > self.peer_settings["last_announce"] + self.peer_settings["announce_interval"]: + self.announce_now() + time.sleep(self.job_interval) def set_display_name(self, display_name): @@ -530,6 +533,7 @@ class NomadNetworkApp: self.message_router.cancel_propagation_node_requests() def announce_now(self): + RNS.log("Sending lxmf.delivery announce", RNS.LOG_VERBOSE) self.message_router.set_inbound_stamp_cost(self.lxmf_destination.hash, self.required_stamp_cost) self.lxmf_destination.display_name = self.peer_settings["display_name"] self.message_router.announce(self.lxmf_destination.hash) @@ -760,6 +764,11 @@ class NomadNetworkApp: value = self.config["client"].as_bool(option) self.peer_announce_at_start = value + if option == "announce_interval": + value = self.config["client"].as_int(option) + if value < 30: value = 30 + self.peer_settings["announce_interval"] = value*60 + if option == "try_propagation_on_send_fail": value = self.config["client"].as_bool(option) self.try_propagation_on_fail = value @@ -1095,6 +1104,10 @@ notify_on_new_message = yes # to let other peers reach it immediately. announce_at_start = yes +# Automatic announce interval in minutes for +# your LXMF address. 6 hours by default. +announce_interval = 360 + # By default, the client will try to deliver a # message via the LXMF propagation network, if # a direct delivery to the recipient is not diff --git a/nomadnet/ui/textui/Guide.py b/nomadnet/ui/textui/Guide.py index ce6bcc5..d67c4c4 100644 --- a/nomadnet/ui/textui/Guide.py +++ b/nomadnet/ui/textui/Guide.py @@ -717,6 +717,12 @@ Sets whether to output a notification character (bell or flash) to the terminal Determines whether your LXMF address is automatically announced when the program starts. Must be a boolean value. < +>>> +`!announce_interval = 360`! +>>>> +Determines how often, in minutes, your LXMF address is announced on the network. Defaults to 6 hours. +< + >>> `!try_propagation_on_send_fail = yes`! >>>>