mirror of
https://github.com/ShadowNinja/LuaIRC.git
synced 2025-07-20 16:40:26 +02:00
Compare commits
1 Commits
isupport
...
hook_conne
Author | SHA1 | Date | |
---|---|---|---|
b07166345a |
16
handlers.lua
16
handlers.lua
@ -90,22 +90,6 @@ handlers["432"] = needNewNick
|
|||||||
-- ERR_NICKNAMEINUSE
|
-- ERR_NICKNAMEINUSE
|
||||||
handlers["433"] = needNewNick
|
handlers["433"] = needNewNick
|
||||||
|
|
||||||
-- RPL_ISUPPORT
|
|
||||||
handlers["005"] = function(o, prefix, nick, ...)
|
|
||||||
local list = {...}
|
|
||||||
local listlen = #list
|
|
||||||
-- Skip last parameter (info)
|
|
||||||
for i = 1, listlen - 1 do
|
|
||||||
local item = list[i]
|
|
||||||
local pos = item:find("=")
|
|
||||||
if pos then
|
|
||||||
o.supports[item:sub(1, pos - 1)] = item:sub(pos + 1)
|
|
||||||
else
|
|
||||||
o.supports[item] = true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
--NAMES list
|
--NAMES list
|
||||||
handlers["353"] = function(o, prefix, me, chanType, channel, names)
|
handlers["353"] = function(o, prefix, me, chanType, channel, names)
|
||||||
if o.track_users then
|
if o.track_users then
|
||||||
|
3
init.lua
3
init.lua
@ -39,7 +39,6 @@ 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)
|
||||||
@ -68,7 +67,7 @@ function meta:invoke(name, ...)
|
|||||||
local hooks = self.hooks[name]
|
local hooks = self.hooks[name]
|
||||||
if hooks then
|
if hooks then
|
||||||
for id, f in pairs(hooks) do
|
for id, f in pairs(hooks) do
|
||||||
if f(...) then
|
if f(self, ...) then
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user