first attempt at giving BBS link over the air
This commit is contained in:
SpudGunMan
2024-10-31 16:38:16 -07:00
parent ab86f02bd7
commit bb0f923155
2 changed files with 23 additions and 1 deletions
+18 -1
View File
@@ -4,7 +4,7 @@
import pickle # pip install pickle
from modules.log import *
trap_list_bbs = ("bbslist", "bbspost", "bbsread", "bbsdelete", "bbshelp", "bbsinfo")
trap_list_bbs = ("bbslist", "bbspost", "bbsread", "bbsdelete", "bbshelp", "bbsinfo", "bbslink", "bbsack")
# global message list, later we will use a pickle on disk
bbs_messages = []
@@ -156,6 +156,23 @@ def bbs_delete_dm(toNode, message):
return "System: cleared mail for" + str(toNode)
return "System: No DM found for node " + str(toNode)
def bbs_sync_posts(input, peerNode, RxNode):
# respond when another bot asks for the bbs posts to sync
# Respond wth the first message
message = bbs_messages[0]
if "bbslink" in input:
# split to get the messageID
lastAck = int(input.split(" ")[1])
# send the next highest messageID
return "bbspost " + str(bbs_messages[lastAck + 1][0])
return message
#initialize the bbsdb's
load_bbsdb()
load_bbsdm()