Make actions work in the IRC client again.. (#2544)

disables printing CTCPs for now.. as this makes actions appear twice.
better fix?
This commit is contained in:
Caitlyn 2017-11-24 02:17:56 -06:00 committed by payonel
parent 0f92e372fd
commit 4cc635e182

View File

@ -217,7 +217,7 @@ 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)
--print("[" .. name(prefix) .. "] CTCP " .. ctcp)
local ctcp, param = ctcp:match("^(%S+) ?(.-)$")
ctcp = ctcp:upper()
if ctcp == "TIME" then
@ -229,17 +229,15 @@ local function handleCommand(prefix, command, args, message)
elseif ctcp == "PING" then
sock:write("NOTICE " .. name(prefix) .. " :\001PING " .. param .. "\001\r\n")
sock:flush()
elseif ctcp == "ACTION" then
print("[" .. args[1] .. "] * " .. name(prefix) .. string.gsub(string.gsub(message, "\001ACTION", ""), "\001", ""))
end
else
if string.find(message, nick) then
computer.beep()
end
if string.find(message, "\001ACTION") then
print("[" .. args[1] .. "] " .. name(prefix) .. string.gsub(string.gsub(message, "\001ACTION", ""), "\001", ""))
else
print("[" .. args[1] .. "] " .. name(prefix) .. ": " .. message)
end
end
elseif command == "NOTICE" then
print("[NOTICE] " .. message)
elseif command == "ERROR" then