diff options
author | Waqas Hussain <waqas20@gmail.com> | 2010-02-12 01:56:18 +0500 |
---|---|---|
committer | Waqas Hussain <waqas20@gmail.com> | 2010-02-12 01:56:18 +0500 |
commit | 9d2742cc9a24a8cd3d92e4e65d3d913dad782d0e (patch) | |
tree | f880d452ee45488f726e8cc002343b318aad1bc7 /plugins | |
parent | bdc87e4345c8ad01a12d9ed0e6a73a102e192102 (diff) | |
download | prosody-9d2742cc9a24a8cd3d92e4e65d3d913dad782d0e.tar.gz prosody-9d2742cc9a24a8cd3d92e4e65d3d913dad782d0e.zip |
mod_tls: Switched to new events API.
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/mod_tls.lua | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/plugins/mod_tls.lua b/plugins/mod_tls.lua index 6fde0a1e..c8c49895 100644 --- a/plugins/mod_tls.lua +++ b/plugins/mod_tls.lua @@ -44,8 +44,18 @@ function s2s_starttls_handler(session, stanza) end end -module:add_handler("c2s_unauthed", "starttls", xmlns_starttls, c2s_starttls_handler); -module:add_handler("s2sin_unauthed", "starttls", xmlns_starttls, s2s_starttls_handler); +module:hook("stanza/urn:ietf:params:xml:ns:xmpp-tls:starttls", function(event) + local origin, stanza = event.origin, event.stanza; + if origin.type == "c2s_unauthed" then + c2s_starttls_handler(origin, stanza); + elseif origin.type == "s2sin_unauthed" then + s2s_starttls_handler(origin, stanza); + else + -- FIXME: What reply? + origin.log("warn", "Attempt to start TLS, but TLS is not available on this %s connection", origin.type); + end + return true; +end); local starttls_attr = { xmlns = xmlns_starttls }; |