From 1a49a81cf51a23469e33256b0d6a447bd3d529e5 Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Sat, 4 Oct 2025 12:54:20 -0700 Subject: [PATCH] load_bbsdb with 'api' allows for ssh file synch? --- modules/bbstools.py | 6 +++++- modules/system.py | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/bbstools.py b/modules/bbstools.py index 7540385..34fa9ae 100644 --- a/modules/bbstools.py +++ b/modules/bbstools.py @@ -16,7 +16,11 @@ def load_bbsdb(): # load the bbs messages from the database file try: with open('data/bbsdb.pkl', 'rb') as f: - bbs_messages = pickle.load(f) + new_bbs_messages = pickle.load(f) + if isinstance(new_bbs_messages, list): + for msg in new_bbs_messages: + if msg not in bbs_messages: + bbs_messages.append(msg) except Exception as e: bbs_messages = [[1, "Welcome to meshBBS", "Welcome to the BBS, please post a message!",0]] logger.debug("System: Creating new data/bbsdb.pkl") diff --git a/modules/system.py b/modules/system.py index d3bd8bc..cdc7ce5 100644 --- a/modules/system.py +++ b/modules/system.py @@ -1351,6 +1351,7 @@ async def watchdog(): # check the load_bbsdm flag to reload the BBS messages from disk if bbs_enabled and bbsAPI_enabled: load_bbsdm() + load_bbsdb() def exit_handler(): # Close the interface and save the BBS messages