mirror of
https://github.com/SpudGunMan/meshing-around.git
synced 2026-08-07 01:13:14 +02:00
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>
This commit is contained in:
+13
-1
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user