Software /
code /
prosody
Comparison
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 |
comparison
equal
deleted
inserted
replaced
5335:bb81c13d2c6f | 5336:eeb24f1e2c84 |
---|---|
104 module:add_identity("proxy", "bytestreams", name); | 104 module:add_identity("proxy", "bytestreams", name); |
105 module:add_feature("http://jabber.org/protocol/bytestreams"); | 105 module:add_feature("http://jabber.org/protocol/bytestreams"); |
106 | 106 |
107 module:hook("iq-get/host/http://jabber.org/protocol/disco#info:query", function(event) | 107 module:hook("iq-get/host/http://jabber.org/protocol/disco#info:query", function(event) |
108 local origin, stanza = event.origin, event.stanza; | 108 local origin, stanza = event.origin, event.stanza; |
109 origin.send(st.reply(stanza):query("http://jabber.org/protocol/disco#info") | 109 if not stanza.tags[1].attr.node then |
110 :tag("identity", {category='proxy', type='bytestreams', name=name}):up() | 110 origin.send(st.reply(stanza):query("http://jabber.org/protocol/disco#info") |
111 :tag("feature", {var="http://jabber.org/protocol/bytestreams"}) ); | 111 :tag("identity", {category='proxy', type='bytestreams', name=name}):up() |
112 return true; | 112 :tag("feature", {var="http://jabber.org/protocol/bytestreams"}) ); |
113 return true; | |
114 end | |
113 end, -1); | 115 end, -1); |
114 | 116 |
115 module:hook("iq-get/host/http://jabber.org/protocol/disco#items:query", function(event) | 117 module:hook("iq-get/host/http://jabber.org/protocol/disco#items:query", function(event) |
116 local origin, stanza = event.origin, event.stanza; | 118 local origin, stanza = event.origin, event.stanza; |
117 origin.send(st.reply(stanza):query("http://jabber.org/protocol/disco#items")); | 119 if not stanza.tags[1].attr.node then |
118 return true; | 120 origin.send(st.reply(stanza):query("http://jabber.org/protocol/disco#items")); |
121 return true; | |
122 end | |
119 end, -1); | 123 end, -1); |
120 | 124 |
121 module:hook("iq-get/host/http://jabber.org/protocol/bytestreams:query", function(event) | 125 module:hook("iq-get/host/http://jabber.org/protocol/bytestreams:query", function(event) |
122 local origin, stanza = event.origin, event.stanza; | 126 local origin, stanza = event.origin, event.stanza; |
123 | 127 |