From 339d3c9d8d6e1871ea4d1cd609f6ffb08ae3f561 Mon Sep 17 00:00:00 2001 From: Joshua Simmons Date: Sun, 18 Jul 2010 19:05:14 +1000 Subject: [PATCH] Passing prefix to mode handlers --- init.lua | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/init.lua b/init.lua index e3c41c5..e2296ec 100644 --- a/init.lua +++ b/init.lua @@ -29,7 +29,7 @@ function meta_preconnect.__index(o, k) end return v end - + function new(user) local o = { 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[id], "hook ID not found") - + hooks[id] = nil end meta_preconnect.unhook = meta.unhook @@ -284,14 +284,14 @@ end --RPL_UMODEIS --To answer a query about a client's own mode, RPL_UMODEIS is sent back -handlers["221"] = function(o, modes) - o:invoke("OnUserModeIs", modes) +handlers["221"] = function(o, prefix, modes) + o:invoke("OnUserModeIs", parsePrefix(prefix), modes) end --RPL_CHANNELMODEIS --user seems to be just a repeat of the user's nick -handlers["324"] = function(o, user, channel, modes) - o.invoke("OnChannelModeIs", user, channel, modes) +handlers["324"] = function(o, prefix, user, channel, modes) + o.invoke("OnChannelModeIs", parsePrefix(prefix), user, channel, modes) end handlers["ERROR"] = function(o, prefix, message)