From 13ee6d4fd6e2bcac7890c61ce09ba3c45ca4d593 Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Fri, 3 Oct 2025 19:02:15 -0700 Subject: [PATCH] enhance bbsDM enable a new 'API' to inject into the pkl file for DM's also see https://github.com/SpudGunMan/meshing-around/commit/2d44faac98bb977d9b3b9f840ca4dfbec71af3dc --- modules/bbstools.py | 6 +++++- modules/system.py | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/modules/bbstools.py b/modules/bbstools.py index 87231b0..7540385 100644 --- a/modules/bbstools.py +++ b/modules/bbstools.py @@ -118,7 +118,11 @@ def load_bbsdm(): # load the bbs messages from the database file try: with open('data/bbsdm.pkl', 'rb') as f: - bbs_dm = pickle.load(f) + new_bbs_dm = pickle.load(f) + if isinstance(new_bbs_dm, list): + for msg in new_bbs_dm: + if msg not in bbs_dm: + bbs_dm.append(msg) except: bbs_dm = [[1234567890, "Message", 1234567890]] logger.debug("System: Creating new data/bbsdm.pkl") diff --git a/modules/system.py b/modules/system.py index ef280f4..0c1c59a 100644 --- a/modules/system.py +++ b/modules/system.py @@ -1347,6 +1347,10 @@ async def watchdog(): # check for noisy telemetry if noisyNodeLogging: noisyTelemetryCheck() + + # check the load_bbsdm flag to reload the BBS messages from disk + if bbs_enabled: + load_bbsdm() def exit_handler(): # Close the interface and save the BBS messages