mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-14 09:46:53 -04:00
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:
parent
7f71953540
commit
62e38f40df
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user