From ca90a682b686c55a1d359a39f41b86ddacaee982 Mon Sep 17 00:00:00 2001 From: Solderpunk Date: Fri, 7 Dec 2018 20:32:55 +0000 Subject: Add support for top-level reply command (outside of ). --- telem.lua | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/telem.lua b/telem.lua index 10f10db..8714581 100755 --- a/telem.lua +++ b/telem.lua @@ -286,6 +286,20 @@ function do_quit() print("Goodbye!") end +function do_reply() + if current_board == "" then + print("Not at any board!") + return + end + print("Reply to which thread?") + local thread_id = string.upper(io.read()) + thread = current_thread_index[tonumber(thread_id)] + current_thread_subject = thread.subject + current_thread_posts = get_posts(thread) + current_thread_index = #current_thread_posts + do_type_reply() +end + function do_rules() cat_file("/var/bbs/docs/rules") end @@ -327,7 +341,7 @@ dispatch["s"] = do_unimplemented dispatch["="] = do_unimplemented dispatch["M"] = do_unimplemented dispatch["n"] = do_new -dispatch["r"] = do_unimplemented +dispatch["r"] = do_reply dispatch["b"] = do_board dispatch["c"] = do_unimplemented -- cgit v1.2.3