changeset 277:07c1c3eaf0c4

mod_tcpproxy: Updated to use events instead of componentmanager.
author Waqas Hussain <waqas20@gmail.com>
date Wed, 10 Nov 2010 21:19:34 +0500
parents 27c652363874
children 653c1826739e
files mod_tcpproxy/mod_tcpproxy.lua
diffstat 1 files changed, 15 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mod_tcpproxy/mod_tcpproxy.lua	Wed Nov 10 21:18:21 2010 +0500
+++ b/mod_tcpproxy/mod_tcpproxy.lua	Wed Nov 10 21:19:34 2010 +0500
@@ -104,4 +104,18 @@
 	end
 end
 
-require "core.componentmanager".register_component(host, proxy_component);
+local function stanza_handler(event)
+	proxy_component(event.origin, event.stanza);
+	return true;
+end
+module:hook("iq/bare", stanza_handler);
+module:hook("message/bare", stanza_handler);
+module:hook("presence/bare", stanza_handler);
+module:hook("iq/full", stanza_handler);
+module:hook("message/full", stanza_handler);
+module:hook("presence/full", stanza_handler);
+module:hook("iq/host", stanza_handler);
+module:hook("message/host", stanza_handler);
+module:hook("presence/host", stanza_handler);
+
+require "core.componentmanager".register_component(host, function() end); -- COMPAT Prosody 0.7