modulemanager initializes hosts[host] if it isn't already initialized when loading...
[prosody.git] / core / modulemanager.lua
index 12cf9ce8c6eb78131ef98fb0f733b69dc309a656..5afe31440cb4395add4355b8f0a6bc151196df94 100644 (file)
@@ -112,6 +112,7 @@ function load(host, module_name, config)
        local pluginenv = setmetatable({ module = api_instance }, { __index = _G });
        
        setfenv(mod, pluginenv);
+       if not hosts[host] then hosts[host] = { type = "component", host = host, connected = false, s2sout = {} }; end
        
        local success, ret = pcall(mod);
        if not success then