diff options
author | Waqas Hussain <waqas20@gmail.com> | 2010-11-10 20:14:33 +0500 |
---|---|---|
committer | Waqas Hussain <waqas20@gmail.com> | 2010-11-10 20:14:33 +0500 |
commit | 557bad86f76f900f26cd510808399faf18e4e213 (patch) | |
tree | da29a7fe3221bb1aa81702f8507af7f7db73e9b5 | |
parent | d1706d1cb578ea661f52564d271968b76b088af1 (diff) | |
download | prosody-557bad86f76f900f26cd510808399faf18e4e213.tar.gz prosody-557bad86f76f900f26cd510808399faf18e4e213.zip |
modulemanager: Return an error when loading a module on a non-existent host, don't create the host. Removes dependecy on componentmanager.
-rw-r--r-- | core/modulemanager.lua | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/core/modulemanager.lua b/core/modulemanager.lua index e228e48d..67a77af6 100644 --- a/core/modulemanager.lua +++ b/core/modulemanager.lua @@ -91,6 +91,8 @@ prosody_events.add_handler("component-activated", load_modules_for_host); function load(host, module_name, config) if not (host and module_name) then return nil, "insufficient-parameters"; + elseif not hosts[host] then + return nil, "unknown-host"; end if not modulemap[host] then @@ -118,11 +120,6 @@ function load(host, module_name, config) api_instance.environment = pluginenv; setfenv(mod, pluginenv); - if not hosts[host] then - local create_component = _G.require "core.componentmanager".create_component; - hosts[host] = create_component(host); - log("debug", "Created new component: %s", host); - end hosts[host].modules = modulemap[host]; modulemap[host][module_name] = pluginenv; |