Changeset

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
parents 5335:bb81c13d2c6f
children 5337:c22dd451487f
files plugins/mod_proxy65.lua
diffstat 1 files changed, 10 insertions(+), 6 deletions(-) [+]
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)