Software /
code /
prosody
Changeset
3558:f1201ff060b7
mod_proxy65: Use "iq/host" event for hooking stanzas instead of the component stanza handler.
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Thu, 04 Nov 2010 19:18:32 +0500 |
parents | 3557:58ab7e61d220 |
children | 3559:0708d42ef0d4 |
files | plugins/mod_proxy65.lua |
diffstat | 1 files changed, 4 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/plugins/mod_proxy65.lua Thu Nov 04 18:44:57 2010 +0500 +++ b/plugins/mod_proxy65.lua Thu Nov 04 19:18:32 2010 +0500 @@ -207,7 +207,8 @@ return reply, from, to, sid; end -function handle_to_domain(origin, stanza) +function handle_to_domain(event) + local origin, stanza = event.origin, event.stanza; local to_node, to_host, to_resource = jid_split(stanza.attr.to); if to_node == nil then local type = stanza.attr.type; @@ -256,6 +257,7 @@ end return; end +module:hook("iq/host", handle_to_domain); if not connlisteners.register(module.host .. ':proxy65', connlistener) then module:log("error", "mod_proxy65: Could not establish a connection listener. Check your configuration please."); @@ -263,4 +265,4 @@ end connlisteners.start(module.host .. ':proxy65'); -component = componentmanager.register_component(host, handle_to_domain); +component = componentmanager.register_component(host, function() end);