Comparison

plugins/mod_proxy65.lua @ 4916:31496e8227e8

mod_proxy65: Warn about pre-0.9 config style (per host proxy65_port)
author Kim Alvefur <zash@zash.se>
date Sun, 27 May 2012 01:17:59 +0200
parent 4729:da3c1d980c04
child 4917:d1dca1d12d53
comparison
equal deleted inserted replaced
4915:3fbc01d1fc5a 4916:31496e8227e8
89 89
90 function module.add_host(module) 90 function module.add_host(module)
91 local host, name = module:get_host(), module:get_option_string("name", "SOCKS5 Bytestreams Service"); 91 local host, name = module:get_host(), module:get_option_string("name", "SOCKS5 Bytestreams Service");
92 92
93 local proxy_address = module:get_option("proxy65_address", host); 93 local proxy_address = module:get_option("proxy65_address", host);
94 local proxy_port = module:get_option_number("proxy65_port", next(portmanager.get_active_services():search("proxy65", nil)[1] or {})); 94 local proxy_port = next(portmanager.get_active_services():search("proxy65", nil)[1] or {});
95 local proxy_acl = module:get_option("proxy65_acl"); 95 local proxy_acl = module:get_option("proxy65_acl");
96
97 -- COMPAT w/pre-0.9 where proxy65_port was specified the components section of the config
98 local legacy_config = module:get_option_number("proxy65_port");
99 if legacy_config then
100 module:log("warn", "proxy65_port is deprecated, please put proxy65_ports = { %d } into the global section instead", legacy_config);
101 end
96 102
97 module:add_identity("proxy", "bytestreams", name); 103 module:add_identity("proxy", "bytestreams", name);
98 module:add_feature("http://jabber.org/protocol/bytestreams"); 104 module:add_feature("http://jabber.org/protocol/bytestreams");
99 105
100 module:hook("iq-get/host/http://jabber.org/protocol/disco#info:query", function(event) 106 module:hook("iq-get/host/http://jabber.org/protocol/disco#info:query", function(event)