Software / code / prosody
Comparison
plugins/mod_proxy65.lua @ 6021:f8c17af769d9
mod_proxy65: Use mod_disco
| author | Florian Zeitz <florob@babelmonkeys.de> |
|---|---|
| date | Wed, 19 Feb 2014 20:13:35 +0100 |
| parent | 5776:bd0ff8ae98a8 |
| child | 6948:e6968e47826d |
comparison
equal
deleted
inserted
replaced
| 6019:e9147a16059d | 6021:f8c17af769d9 |
|---|---|
| 99 local legacy_config = module:get_option_number("proxy65_port"); | 99 local legacy_config = module:get_option_number("proxy65_port"); |
| 100 if legacy_config then | 100 if legacy_config then |
| 101 module:log("warn", "proxy65_port is deprecated, please put proxy65_ports = { %d } into the global section instead", legacy_config); | 101 module:log("warn", "proxy65_port is deprecated, please put proxy65_ports = { %d } into the global section instead", legacy_config); |
| 102 end | 102 end |
| 103 | 103 |
| 104 module:depends("disco"); | |
| 104 module:add_identity("proxy", "bytestreams", name); | 105 module:add_identity("proxy", "bytestreams", name); |
| 105 module:add_feature("http://jabber.org/protocol/bytestreams"); | 106 module:add_feature("http://jabber.org/protocol/bytestreams"); |
| 106 | |
| 107 module:hook("iq-get/host/http://jabber.org/protocol/disco#info:query", function(event) | |
| 108 local origin, stanza = event.origin, event.stanza; | |
| 109 if not stanza.tags[1].attr.node then | |
| 110 origin.send(st.reply(stanza):query("http://jabber.org/protocol/disco#info") | |
| 111 :tag("identity", {category='proxy', type='bytestreams', name=name}):up() | |
| 112 :tag("feature", {var="http://jabber.org/protocol/bytestreams"}) ); | |
| 113 return true; | |
| 114 end | |
| 115 end, -1); | |
| 116 | |
| 117 module:hook("iq-get/host/http://jabber.org/protocol/disco#items:query", function(event) | |
| 118 local origin, stanza = event.origin, event.stanza; | |
| 119 if not stanza.tags[1].attr.node then | |
| 120 origin.send(st.reply(stanza):query("http://jabber.org/protocol/disco#items")); | |
| 121 return true; | |
| 122 end | |
| 123 end, -1); | |
| 124 | 107 |
| 125 module:hook("iq-get/host/http://jabber.org/protocol/bytestreams:query", function(event) | 108 module:hook("iq-get/host/http://jabber.org/protocol/bytestreams:query", function(event) |
| 126 local origin, stanza = event.origin, event.stanza; | 109 local origin, stanza = event.origin, event.stanza; |
| 127 | 110 |
| 128 -- check ACL | 111 -- check ACL |