Adding OnModeChange hook

This commit is contained in:
Joshua Simmons 2010-07-20 13:35:25 +10:00
parent 98ccd99f4d
commit 04dbe436f3
2 changed files with 5 additions and 0 deletions

View File

@ -139,6 +139,7 @@ function irc:shutdown()
-- <li><code>OnKick(channel, nick, kicker, reason)</code>* (kicker is a <code>user</code> table)</li>
-- <li><code>OnUserModeIs(modes)</code></li>
-- <li><code>OnChannelModeIs(user, channel, modes)</code></li>
-- <li><code>OnModeChange(user, target, modes)</code>*</li>
-- </ul>
-- * Event also invoked for yourself.
-- † Channel passed only when user tracking is enabled

View File

@ -298,6 +298,10 @@ handlers["324"] = function(o, prefix, user, channel, modes)
o:invoke("OnChannelModeIs", channel, modes)
end
handlers["MODE"] = function(o, prefix, target, modes)
o:invoke("OnModeChange", parsePrefix(prefix), target, modes)
end
handlers["ERROR"] = function(o, prefix, message)
o:invoke("OnDisconnect", message, true)
o:shutdown()