Uuh... We didn't have periodic lxmf announces?

This commit is contained in:
Mark Qvist 2026-05-16 22:58:56 +02:00
parent 5c76d509d7
commit c4b0bd0b57
2 changed files with 20 additions and 1 deletions

View file

@ -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

View file

@ -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`!
>>>>