mirror of
https://github.com/ShadowNinja/LuaIRC.git
synced 2025-01-09 17:40:29 +01:00
Passing prefix to mode handlers
This commit is contained in:
parent
7d891b2380
commit
339d3c9d8d
12
init.lua
12
init.lua
@ -29,7 +29,7 @@ function meta_preconnect.__index(o, k)
|
|||||||
end
|
end
|
||||||
return v
|
return v
|
||||||
end
|
end
|
||||||
|
|
||||||
function new(user)
|
function new(user)
|
||||||
local o = {
|
local o = {
|
||||||
nick = assert(user.nick, "Field 'nick' is required");
|
nick = assert(user.nick, "Field 'nick' is required");
|
||||||
@ -55,7 +55,7 @@ function meta:unhook(name, id)
|
|||||||
|
|
||||||
assert(hooks, "no hooks exist for this event")
|
assert(hooks, "no hooks exist for this event")
|
||||||
assert(hooks[id], "hook ID not found")
|
assert(hooks[id], "hook ID not found")
|
||||||
|
|
||||||
hooks[id] = nil
|
hooks[id] = nil
|
||||||
end
|
end
|
||||||
meta_preconnect.unhook = meta.unhook
|
meta_preconnect.unhook = meta.unhook
|
||||||
@ -284,14 +284,14 @@ end
|
|||||||
|
|
||||||
--RPL_UMODEIS
|
--RPL_UMODEIS
|
||||||
--To answer a query about a client's own mode, RPL_UMODEIS is sent back
|
--To answer a query about a client's own mode, RPL_UMODEIS is sent back
|
||||||
handlers["221"] = function(o, modes)
|
handlers["221"] = function(o, prefix, modes)
|
||||||
o:invoke("OnUserModeIs", modes)
|
o:invoke("OnUserModeIs", parsePrefix(prefix), modes)
|
||||||
end
|
end
|
||||||
|
|
||||||
--RPL_CHANNELMODEIS
|
--RPL_CHANNELMODEIS
|
||||||
--user seems to be just a repeat of the user's nick
|
--user seems to be just a repeat of the user's nick
|
||||||
handlers["324"] = function(o, user, channel, modes)
|
handlers["324"] = function(o, prefix, user, channel, modes)
|
||||||
o.invoke("OnChannelModeIs", user, channel, modes)
|
o.invoke("OnChannelModeIs", parsePrefix(prefix), user, channel, modes)
|
||||||
end
|
end
|
||||||
|
|
||||||
handlers["ERROR"] = function(o, prefix, message)
|
handlers["ERROR"] = function(o, prefix, message)
|
||||||
|
Loading…
Reference in New Issue
Block a user