modulemanager: Changed to use util.pluginloader

Sun, 14 Jun 2009 21:03:59 +0500

author
Waqas Hussain <waqas20@gmail.com>
date
Sun, 14 Jun 2009 21:03:59 +0500
changeset 1360
857034905016
parent 1359
015d624a2a71
child 1361
4e56889c33e1

modulemanager: Changed to use util.pluginloader

core/modulemanager.lua file | annotate | diff | comparison | revisions
--- a/core/modulemanager.lua	Sun Jun 14 21:01:30 2009 +0500
+++ b/core/modulemanager.lua	Sun Jun 14 21:03:59 2009 +0500
@@ -18,6 +18,7 @@
 local multitable_new = require "util.multitable".new;
 local register_actions = require "core.actions".register;
 local st = require "util.stanza";
+local pluginloader = require "util.pluginloader";
 
 local hosts = hosts;
 local prosody = prosody;
@@ -113,7 +114,7 @@
 	end
 	
 
-	local mod, err = loadfile(get_module_filename(module_name));
+	local mod, err = pluginloader.load_code(module_name);
 	if not mod then
 		log("error", "Unable to load module '%s': %s", module_name or "nil", err or "nil");
 		return nil, err;
@@ -187,7 +188,7 @@
 	local mod = get_module(host, name);
 	if not mod then return nil, "module-not-loaded"; end
 
-	local _mod, err = loadfile(get_module_filename(name)); -- checking for syntax errors
+	local _mod, err = pluginloader.load_code(name); -- checking for syntax errors
 	if not _mod then
 		log("error", "Unable to load module '%s': %s", module_name or "nil", err or "nil");
 		return nil, err;

mercurial