1
0
mirror of https://github.com/ShadowNinja/LuaIRC.git synced 2025-07-20 16:40:26 +02:00

1 Commits

Author SHA1 Message Date
1bd7833f18 Add RPL_ISUPPORT parsing 2014-02-26 14:48:10 -05:00
2 changed files with 15 additions and 9 deletions

View File

@ -90,15 +90,20 @@ handlers["432"] = needNewNick
-- ERR_NICKNAMEINUSE -- ERR_NICKNAMEINUSE
handlers["433"] = needNewNick handlers["433"] = needNewNick
-- RPL_MOTDSTART -- RPL_ISUPPORT
handlers["375"] = function(o, prefix, info) handlers["005"] = function(o, prefix, nick, ...)
o.motd = "" local list = {...}
end local listlen = #list
-- Skip last parameter (info)
-- RPL_MOTD for i = 1, listlen - 1 do
handlers["372"] = function(o, prefix, nick, line) local item = list[i]
-- MOTD lines have a "- " prefix, strip it. local pos = item:find("=")
o.motd = o.motd..line:sub(3)..'\n' if pos then
o.supports[item:sub(1, pos - 1)] = item:sub(pos + 1)
else
o.supports[item] = true
end
end
end end
--NAMES list --NAMES list

View File

@ -39,6 +39,7 @@ function new(data)
nickGenerator = data.nickGenerator or defaultNickGenerator; nickGenerator = data.nickGenerator or defaultNickGenerator;
hooks = {}; hooks = {};
track_users = true; track_users = true;
supports = {};
} }
assert(checkNick(o.nick), "Erroneous nickname passed to irc.new") assert(checkNick(o.nick), "Erroneous nickname passed to irc.new")
return setmetatable(o, meta_preconnect) return setmetatable(o, meta_preconnect)