Fix for never checking if the first module for a host is already loaded (affects...
[prosody.git] / core / modulemanager.lua
index e35ea6a6c4ba7e5a699ec35a3f54d776fd99f252..12cf9ce8c6eb78131ef98fb0f733b69dc309a656 100644 (file)
@@ -1,6 +1,6 @@
 -- Prosody IM v0.3
--- Copyright (C) 2008 Matthew Wild
--- Copyright (C) 2008 Waqas Hussain
+-- Copyright (C) 2008-2009 Matthew Wild
+-- Copyright (C) 2008-2009 Waqas Hussain
 -- 
 -- This project is MIT/X11 licensed. Please see the
 -- COPYING file in the source package for more information.
@@ -90,7 +90,9 @@ function load(host, module_name, config)
        
        if not modulemap[host] then
                modulemap[host] = {};
-       elseif modulemap[host][module_name] then
+       end
+       
+       if modulemap[host][module_name] then
                log("warn", "%s is already loaded for %s, so not loading again", module_name, host);
                return nil, "module-already-loaded";
        elseif modulemap["*"][module_name] then