Add PreRegister hook

This is useful for CAP commands and SASL.
This commit is contained in:
ShadowNinja 2013-06-17 11:29:52 -04:00
parent ad53b2aeb1
commit 1d0480adba
2 changed files with 4 additions and 0 deletions

View File

@ -125,6 +125,7 @@ function irc:shutdown()
--- List of hooks you can use with irc:hook. The parameter list describes the parameters passed to the callback function.
-- <ul>
-- <li><code>PreRegister(connection)</code>Useful for CAP commands and SASL.</li>
-- <li><code>OnRaw(line) - (any non false/nil return value assumes line handled and will not be further processed)</code></li>
-- <li><code>OnDisconnect(message, errorOccurred)</code></li>
-- <li><code>OnChat(user, channel, message)</code></li>

View File

@ -116,6 +116,9 @@ function meta_preconnect:connect(_host, _port)
self.socket = s
setmetatable(self, meta)
self:invoke("PreRegister", self)
self:send("CAP END")
if password then
self:send("PASS %s", password)