Comparison

core/modulemanager.lua @ 1505:e19cb945c25b

modulemanager: Small code improvement, move autoloaded modules list to the top of the file
author Matthew Wild <mwild1@gmail.com>
date Thu, 09 Jul 2009 14:37:04 +0100
parent 1504:9d8c35e98ca2
child 1523:841d61be198f
comparison
equal deleted inserted replaced
1504:9d8c35e98ca2 1505:e19cb945c25b
30 local type = type; 30 local type = type;
31 local next = next; 31 local next = next;
32 local rawget = rawget; 32 local rawget = rawget;
33 local error = error; 33 local error = error;
34 local tostring = tostring; 34 local tostring = tostring;
35
36 local autoload_modules = {"presence", "message", "iq"};
35 37
36 -- We need this to let modules access the real global namespace 38 -- We need this to let modules access the real global namespace
37 local _G = _G; 39 local _G = _G;
38 40
39 module "modulemanager" 41 module "modulemanager"
68 if modules_disabled then 70 if modules_disabled then
69 for _, module in ipairs(modules_disabled) do 71 for _, module in ipairs(modules_disabled) do
70 disabled_set[module] = true; 72 disabled_set[module] = true;
71 end 73 end
72 end 74 end
73 for _, module in ipairs({"presence", "message", "iq"}) do 75 for _, module in ipairs(autoload_modules) do
74 if not disabled_set[module] then 76 if not disabled_set[module] then
75 load(host, module); 77 load(host, module);
76 end 78 end
77 end 79 end
78 for _, module in ipairs(modules_enabled) do 80 for _, module in ipairs(modules_enabled) do