From 9b69ca69c4d59326be3ea6958d364b5a1b3094bf Mon Sep 17 00:00:00 2001 From: Kelly Date: Thu, 5 Mar 2026 21:26:42 -0800 Subject: [PATCH] fix link parsing This fixes an issue with how the bbslink sync process was handling incoming posts. It was not removing the @fromNode from the end of the body, which was causing it to get appended again during the push process. This would compound with more nodes involved in the sync process alt to https://github.com/SpudGunMan/meshing-around/pull/296 Co-Authored-By: Amy Nagle <1270500+kabili207@users.noreply.github.com> --- modules/bbstools.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/modules/bbstools.py b/modules/bbstools.py index 1861e39..af837d9 100644 --- a/modules/bbstools.py +++ b/modules/bbstools.py @@ -255,7 +255,19 @@ def bbs_sync_posts(input, peerNode, RxNode): #store the message subject = input.split("$")[1].split("#")[0] body = input.split("#")[1] - fromNodeHex = input.split("@")[1] + fromNodeHex = body.split("@")[1] + #validate the fromNodeHex is a valid hex number + try: + int(fromNodeHex, 16) + except ValueError: + logger.error(f"System: Invalid fromNodeHex in bbslink from node {peerNode}: {input}") + fromNodeHex = hex(peerNode) + #validate the subject and body are not empty + if subject.strip() == "" or body.strip() == "": + logger.error(f"System: Empty subject or body in bbslink from node {peerNode}: {input}") + return "System: Invalid bbslink format." + + #store the message in the bbsdb try: bbs_post_message(subject, body, int(fromNodeHex, 16)) except: