Readd the printing of a CTCP if it wasn't handled.

No I haven't tested this, what are you talking about?
This commit is contained in:
Skye 2017-11-27 19:03:39 +00:00 committed by payonel
parent 7f71953540
commit 62e38f40df

View File

@ -217,9 +217,8 @@ local function handleCommand(prefix, command, args, message)
elseif command == "PRIVMSG" then elseif command == "PRIVMSG" then
local ctcp = message:match("^\1(.-)\1$") local ctcp = message:match("^\1(.-)\1$")
if ctcp then if ctcp then
--print("[" .. name(prefix) .. "] CTCP " .. ctcp) local orig_ctcp, param = ctcp:match("^(%S+) ?(.-)$")
local ctcp, param = ctcp:match("^(%S+) ?(.-)$") ctcp = orig_ctcp:upper()
ctcp = ctcp:upper()
if ctcp == "TIME" then if ctcp == "TIME" then
sock:write("NOTICE " .. name(prefix) .. " :\001TIME " .. os.date() .. "\001\r\n") sock:write("NOTICE " .. name(prefix) .. " :\001TIME " .. os.date() .. "\001\r\n")
sock:flush() sock:flush()
@ -231,6 +230,9 @@ local function handleCommand(prefix, command, args, message)
sock:flush() sock:flush()
elseif ctcp == "ACTION" then elseif ctcp == "ACTION" then
print("[" .. args[1] .. "] * " .. name(prefix) .. string.gsub(string.gsub(message, "\001ACTION", ""), "\001", "")) print("[" .. args[1] .. "] * " .. name(prefix) .. string.gsub(string.gsub(message, "\001ACTION", ""), "\001", ""))
else
-- Here we print the CTCP message if it was unhandled...
print("[" .. name(prefix) .. "] CTCP " .. orig_ctcp)
end end
else else
if string.find(message, nick) then if string.find(message, nick) then