Mercurial > prosody-modules
comparison mod_tcpproxy/mod_tcpproxy.lua @ 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 | 31e24026e4fd |
children | 10c3f6c6a04c |
comparison
equal
deleted
inserted
replaced
276:27c652363874 | 277:07c1c3eaf0c4 |
---|---|
102 return origin.send(st.error_reply(stanza, "cancel", "item-not-found")); | 102 return origin.send(st.error_reply(stanza, "cancel", "item-not-found")); |
103 end | 103 end |
104 end | 104 end |
105 end | 105 end |
106 | 106 |
107 require "core.componentmanager".register_component(host, proxy_component); | 107 local function stanza_handler(event) |
108 proxy_component(event.origin, event.stanza); | |
109 return true; | |
110 end | |
111 module:hook("iq/bare", stanza_handler); | |
112 module:hook("message/bare", stanza_handler); | |
113 module:hook("presence/bare", stanza_handler); | |
114 module:hook("iq/full", stanza_handler); | |
115 module:hook("message/full", stanza_handler); | |
116 module:hook("presence/full", stanza_handler); | |
117 module:hook("iq/host", stanza_handler); | |
118 module:hook("message/host", stanza_handler); | |
119 module:hook("presence/host", stanza_handler); | |
120 | |
121 require "core.componentmanager".register_component(host, function() end); -- COMPAT Prosody 0.7 |