From 9e06c3bd5cc3119333f211115513e8ae6b1cc8c6 Mon Sep 17 00:00:00 2001 From: Waqas Hussain Date: Tue, 26 Feb 2013 23:57:44 +0500 Subject: mod_proxy65: Only handle service discovery requests when no node is present in the request. --- plugins/mod_proxy65.lua | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'plugins/mod_proxy65.lua') diff --git a/plugins/mod_proxy65.lua b/plugins/mod_proxy65.lua index d6e41604..0d05b2ac 100644 --- a/plugins/mod_proxy65.lua +++ b/plugins/mod_proxy65.lua @@ -106,16 +106,20 @@ function module.add_host(module) 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) -- cgit v1.2.3