From 62e38f40df92b15f72c0640d70bb44279ebe6a5b Mon Sep 17 00:00:00 2001 From: Skye Date: Mon, 27 Nov 2017 19:03:39 +0000 Subject: [PATCH] Readd the printing of a CTCP if it wasn't handled. No I haven't tested this, what are you talking about? --- .../assets/opencomputers/loot/irc/usr/bin/irc.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/resources/assets/opencomputers/loot/irc/usr/bin/irc.lua b/src/main/resources/assets/opencomputers/loot/irc/usr/bin/irc.lua index 86ef4b144..52876eb47 100644 --- a/src/main/resources/assets/opencomputers/loot/irc/usr/bin/irc.lua +++ b/src/main/resources/assets/opencomputers/loot/irc/usr/bin/irc.lua @@ -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