Diff

core/modulemanager.lua @ 467:66f145f5c932

Update Makefile to now pass config paths to prosody. Update prosody, modulemanager and connectionlisteners to obey these paths.
author Matthew Wild <mwild1@gmail.com>
date Sat, 29 Nov 2008 03:27:50 +0000
parent 439:6608ad3a72f3
child 519:cccd610a0ef9
line wrap: on
line diff
--- a/core/modulemanager.lua	Sat Nov 29 03:26:46 2008 +0000
+++ b/core/modulemanager.lua	Sat Nov 29 03:27:50 2008 +0000
@@ -1,4 +1,5 @@
 
+local plugin_dir = CFG_PLUGINDIR or "./plugins/";
 
 local logger = require "util.logger";
 local log = logger.init("modulemanager")
@@ -11,8 +12,8 @@
 
 local tostring, print = tostring, print;
 
+-- We need this to let modules access the real global namespace
 local _G = _G;
-local debug = debug;
 
 module "modulemanager"
 
@@ -30,7 +31,7 @@
 	if not (host and module_name) then
 		return nil, "insufficient-parameters";
 	end
-	local mod, err = loadfile("plugins/mod_"..module_name..".lua");
+	local mod, err = loadfile(plugin_dir.."mod_"..module_name..".lua");
 	if not mod then
 		log("error", "Unable to load module '%s': %s", module_name or "nil", err or "nil");
 		return nil, err;