Software /
code /
prosody
Diff
plugins/mod_proxy65.lua @ 5336:eeb24f1e2c84
mod_proxy65: Only handle service discovery requests when no node is present in the request.
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Tue, 26 Feb 2013 23:57:44 +0500 |
parent | 4921:9a01c6bc435e |
child | 5375:b31ab26f9997 |
line wrap: on
line diff
--- a/plugins/mod_proxy65.lua Tue Feb 26 23:56:44 2013 +0500 +++ b/plugins/mod_proxy65.lua Tue Feb 26 23:57:44 2013 +0500 @@ -106,16 +106,20 @@ module:hook("iq-get/host/http://jabber.org/protocol/disco#info:query", function(event) local origin, stanza = event.origin, event.stanza; - origin.send(st.reply(stanza):query("http://jabber.org/protocol/disco#info") - :tag("identity", {category='proxy', type='bytestreams', name=name}):up() - :tag("feature", {var="http://jabber.org/protocol/bytestreams"}) ); - return true; + if not stanza.tags[1].attr.node then + origin.send(st.reply(stanza):query("http://jabber.org/protocol/disco#info") + :tag("identity", {category='proxy', type='bytestreams', name=name}):up() + :tag("feature", {var="http://jabber.org/protocol/bytestreams"}) ); + return true; + end end, -1); module:hook("iq-get/host/http://jabber.org/protocol/disco#items:query", function(event) local origin, stanza = event.origin, event.stanza; - origin.send(st.reply(stanza):query("http://jabber.org/protocol/disco#items")); - return true; + if not stanza.tags[1].attr.node then + origin.send(st.reply(stanza):query("http://jabber.org/protocol/disco#items")); + return true; + end end, -1); module:hook("iq-get/host/http://jabber.org/protocol/bytestreams:query", function(event)