Comparison

core/modulemanager.lua @ 4801:83cedf648b46

modulemanager: Hide deprecation warning for modules loaded on '*' directly (e.g. prosodyctl mod_<command>) (thanks Zash)
author Matthew Wild <mwild1@gmail.com>
date Sun, 29 Apr 2012 19:36:11 +0100
parent 4776:dbe9d75c0452
child 4804:607414b26c8c
comparison
equal deleted inserted replaced
4800:7ce502f21270 4801:83cedf648b46
178 end 178 end
179 end 179 end
180 180
181 if api_instance.host == "*" then 181 if api_instance.host == "*" then
182 if not api_instance.global then -- COMPAT w/pre-0.9 182 if not api_instance.global then -- COMPAT w/pre-0.9
183 log("warn", "mod_%s: Setting module.host = '*' deprecated, call module:set_global() instead", module_name); 183 if host ~= "*" then
184 log("warn", "mod_%s: Setting module.host = '*' deprecated, call module:set_global() instead", module_name);
185 end
184 api_instance:set_global(); 186 api_instance:set_global();
185 end 187 end
186 modulemap[host][module_name] = nil; 188 modulemap[host][module_name] = nil;
187 modulemap[api_instance.host][module_name] = pluginenv; 189 modulemap[api_instance.host][module_name] = pluginenv;
188 if host ~= api_instance.host and module_has_method(pluginenv, "add_host") then 190 if host ~= api_instance.host and module_has_method(pluginenv, "add_host") then