Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add in BBS-DM via node hex ID #67

Merged
merged 6 commits into from
Sep 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion mesh_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,14 @@ def handle_bbspost(message, message_from_id, deviceID):
elif "@" in message and not "example:" in message:
toNode = message.split("@")[1].split("#")[0]
toNode = toNode.rstrip()
if toNode.isalpha() or not toNode.isnumeric():
# if toNode preceded by !, or is 8 characters long try to interpret as hex
if "!" in toNode or len(toNode) == 8:
try:
toNode = int(toNode.strip("!"),16)
except ValueError as e:
logger.debug("toNode is not hex, error: {e}")
# if toNode is all alpha or not totally numeric, see if it is a shortname
elif toNode.isalpha() or not toNode.isnumeric():
toNode = get_num_from_short_name(toNode, deviceID)
if toNode == 0:
return "Node not found " + message.split("@")[1].split("#")[0]
Expand Down