X-Git-Url: https://git.enpas.org/?a=blobdiff_plain;f=prosody;h=52488639c62f7b588c5e6eae5f68a92642a25aad;hb=de253ecbd45a583021d25fb87fb88a96ba1d04c1;hp=385997a65bba4f77e5bd8105f658a0759a4a2c4b;hpb=c7cf232d88bd51fecabf1d9db37450b9e3e0317d;p=prosody.git diff --git a/prosody b/prosody index 385997a6..52488639 100755 --- a/prosody +++ b/prosody @@ -150,10 +150,14 @@ function sandbox_require() local curr_env_mt = getmetatable(getfenv(2)); local _realG_mt = getmetatable(_realG); if curr_env_mt and curr_env_mt.__index and not curr_env_mt.__newindex and _realG_mt then - local old_newindex + local old_newindex, old_index; old_newindex, _realG_mt.__newindex = _realG_mt.__newindex, curr_env; + old_index, _realG_mt.__index = _realG_mt.__index, function (_G, k) + return rawget(curr_env, k); + end; local ret = _real_require(...); _realG_mt.__newindex = old_newindex; + _realG_mt.__index = old_index; return ret; end return _real_require(...); @@ -275,11 +279,12 @@ function load_secondary_libraries() require "util.import" require "util.xmppstream" require "core.rostermanager" + require "core.stanza_router" require "core.hostmanager" + require "core.portmanager" require "core.modulemanager" require "core.usermanager" require "core.sessionmanager" - require "core.stanza_router" package.loaded['core.componentmanager'] = setmetatable({},{__index=function() log("warn", "componentmanager is deprecated: %s", debug.traceback():match("\n[^\n]*\n[ \t]*([^\n]*)")); return function() end @@ -302,8 +307,6 @@ function load_secondary_libraries() if remdebug then remdebug.engine.start() end ]] - require "net.httpserver"; - require "util.stanza" require "util.jid" end