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 |