local input_string = io.stdin:read("*all")
- if string.match(input_string, "^get%s%w+%s$") then
+ if string.match(input_string, "^%s*get") then
- local user_name = string.match(input_string, "^get%s(%w+)%s$")
+ local user_name = string.match(input_string, "^%s*get%s+(%w+)%s*$")
+ if user_name then
+ nncp_usernames[node_id] = user_name
+ store_nncp_usernames()
+ else
+ user_name = nncp_usernames[node_id]
+ end
- nncp_usernames[node_id] = user_name
- store_nncp_usernames()
+ if not user_name then
+ print("Error: no known handle for node " .. node_id .. ". Aborting.")
+ return false
+ end
print("Building QWK packet for user '" .. user_name .. "'")
-- Construct QWK packet
local user_name = nncp_usernames[node_id]
if not user_name then
- print("No user name for node " .. node_id .. " found. Aborting.")
+ print("Error: No user name for node " .. node_id .. " found. Aborting.")
return false
end