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
local ctcp = message:match("^\1(.-)\1$")
if ctcp then
--print("[" .. name(prefix) .. "] CTCP " .. ctcp)
local ctcp, param = ctcp:match("^(%S+) ?(.-)$")
ctcp = ctcp:upper()
local orig_ctcp, param = ctcp:match("^(%S+) ?(.-)$")
ctcp = orig_ctcp:upper()
if ctcp == "TIME" then
sock:write("NOTICE " .. name(prefix) .. " :\001TIME " .. os.date() .. "\001\r\n")
sock:flush()
@ -231,6 +230,9 @@ local function handleCommand(prefix, command, args, message)
sock:flush()
elseif ctcp == "ACTION" then
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
else
if string.find(message, nick) then