From 581ec4f0fd98d60f0f6243d6caaa23e8783c5275 Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Thu, 22 Dec 2022 11:47:05 +0100 Subject: [PATCH] Fixed double announce at startup --- sbapp/sideband/core.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/sbapp/sideband/core.py b/sbapp/sideband/core.py index aeb3fec..6cf81c5 100644 --- a/sbapp/sideband/core.py +++ b/sbapp/sideband/core.py @@ -1272,6 +1272,9 @@ class SidebandCore(): now = time.time() announce_wanted = self.getstate("wants.announce") + # TODO: The "start_announce" config entry should be + # renamed to "auto_announce", which is its current + # meaning. if self.config["start_announce"] == True: needs_if_change_announce = False for interface in RNS.Transport.interfaces: @@ -1411,14 +1414,15 @@ class SidebandCore(): self.setpersistent("lxmf.syncretrying", False) def __start_jobs_deferred(self): - if self.config["start_announce"]: - self.lxmf_announce() - if self.is_service: self.service_thread = threading.Thread(target=self._service_jobs, daemon=True) self.service_thread.start() - if self.is_standalone or self.is_service: + if self.is_standalone or self.is_service: + if self.config["start_announce"]: + self.lxmf_announce() + self.last_if_change_announce = time.time() + self.periodic_thread = threading.Thread(target=self._periodic_jobs, daemon=True) self.periodic_thread.start()