Skip to content

Resolution - Issue #87 #122

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
20 changes: 14 additions & 6 deletions command_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,11 +198,16 @@ def handle_bb_steps(sender_id, message, step, state, interface, bbs_nodes):
update_user_state(sender_id, {'command': 'BULLETIN_POST', 'step': 4, 'board': board_name})

elif step == 3:
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: {date}\nSubject: {subject}\n- - - - - - -\n{content}", sender_id, interface)
board_name = state['board']
handle_bb_steps(sender_id, 'e', 1, state, interface, bbs_nodes)
try:
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: {date}\nSubject: {subject}\n- - - - - - -\n{content}", sender_id, interface)
board_name = state['board']
handle_bb_steps(sender_id, 'e', 1, state, interface, bbs_nodes)
except ValueError:
logging.info(f"Node {sender_id} entered a non-integer value in the read bulletin menu")
send_message("Your message must only contain the bulletin number Try again or e[X]it.", sender_id, interface)


elif step == 4:
subject = message
Expand Down Expand Up @@ -255,8 +260,8 @@ def handle_mail_steps(sender_id, message, step, state, interface, bbs_nodes):
handle_help_command(sender_id, interface)

elif step == 2:
mail_id = int(message)
try:
mail_id = int(message)
sender_node_id = get_node_id_from_num(sender_id, interface)
sender, date, subject, content, unique_id = get_mail_content(mail_id, sender_node_id)
send_message(f"Date: {date}\nFrom: {sender}\nSubject: {subject}\n{content}", sender_id, interface)
Expand All @@ -266,6 +271,9 @@ def handle_mail_steps(sender_id, message, step, state, interface, bbs_nodes):
logging.info(f"Node {sender_id} tried to access non-existent message")
send_message("Mail not found", sender_id, interface)
update_user_state(sender_id, None)
except ValueError:
logging.info(f"Node {sender_id} entered a non-integer value in the read mail menu")
send_message("Your message must only contain the message number Try again or e[X]it.", sender_id, interface)

elif step == 3:
short_name = message.lower()
Expand Down