mirror of
https://github.com/TheCommsChannel/TC2-BBS-mesh.git
synced 2025-08-09 23:22:20 -04:00
Update command_handlers.py
This commit is contained in:
parent
c486df150a
commit
9aa8d087e3
1 changed files with 13 additions and 4 deletions
|
@ -213,14 +213,23 @@ def handle_bb_steps(sender_id, message, step, state, interface, bbs_nodes):
|
||||||
|
|
||||||
elif step == 3:
|
elif step == 3:
|
||||||
command = state['command']
|
command = state['command']
|
||||||
|
bulletin_id = int(message)
|
||||||
|
sender_short_name, date, subject, content, unique_id = get_bulletin_content(bulletin_id)
|
||||||
if command == 'BULLETIN_READ':
|
if command == 'BULLETIN_READ':
|
||||||
bulletin_id = int(message)
|
|
||||||
sender_short_name, date, subject, content, unique_id = get_bulletin_content(bulletin_id)
|
|
||||||
send_message(f"From: {sender_short_name}\nDate: {datum(date)}\nSubject: {subject}\n- - - - - - -\n{content}", sender_id, interface)
|
send_message(f"From: {sender_short_name}\nDate: {datum(date)}\nSubject: {subject}\n- - - - - - -\n{content}", sender_id, interface)
|
||||||
board_name = state['board']
|
board_name = state['board']
|
||||||
handle_bb_steps(sender_id, 'r', 2, state, interface, bbs_nodes)
|
handle_bb_steps(sender_id, 'r', 2, state, interface, bbs_nodes)
|
||||||
else:
|
else:
|
||||||
send_message(f"Trying to delete, dont know how yet", sender_id, interface)
|
node_id = get_node_id_from_num(sender_id, interface)
|
||||||
|
node_info = interface.nodes.get(node_id)
|
||||||
|
if node_info is None:
|
||||||
|
send_message("Error: Unable to retrieve your node information.", sender_id, interface)
|
||||||
|
update_user_state(sender_id, None)
|
||||||
|
return
|
||||||
|
your_short_name = node_info['user'].get('shortName', f"Node {sender_id}")
|
||||||
|
send_message(f"You are {your_short_name}", sender_id, interface)
|
||||||
|
if your_short_name == sender_short_name:
|
||||||
|
send_message("Deleting allowed", sender_id, interface)
|
||||||
handle_bb_steps(sender_id, 'd', 2, state, interface, bbs_nodes)
|
handle_bb_steps(sender_id, 'd', 2, state, interface, bbs_nodes)
|
||||||
|
|
||||||
elif step == 4:
|
elif step == 4:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue