aboutsummaryrefslogtreecommitdiffstats
path: root/core/modulemanager.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2009-01-12 04:05:10 +0000
committerMatthew Wild <mwild1@gmail.com>2009-01-12 04:05:10 +0000
commit9ffcaaa1f99a185bec4160399d0b8f52a70a7527 (patch)
tree93939e713530247bb8506050d99b855da837680d /core/modulemanager.lua
parente50d22fcc44c67d513e6b527305134831bdd327b (diff)
downloadprosody-9ffcaaa1f99a185bec4160399d0b8f52a70a7527.tar.gz
prosody-9ffcaaa1f99a185bec4160399d0b8f52a70a7527.zip
Add core.actions for managing server 'actions'; and make modulemanager register actions 'load' and 'unload'
Diffstat (limited to 'core/modulemanager.lua')
-rw-r--r--core/modulemanager.lua15
1 files changed, 14 insertions, 1 deletions
diff --git a/core/modulemanager.lua b/core/modulemanager.lua
index 3481aac6..6ef39e82 100644
--- a/core/modulemanager.lua
+++ b/core/modulemanager.lua
@@ -27,7 +27,7 @@ local addDiscoInfoHandler = require "core.discomanager".addDiscoInfoHandler;
local eventmanager = require "core.eventmanager";
local config = require "core.configmanager";
local multitable_new = require "util.multitable".new;
-
+local register_actions = require "core.actions".register;
local loadfile, pcall = loadfile, pcall;
local setmetatable, setfenv, getfenv = setmetatable, setfenv, getfenv;
@@ -254,4 +254,17 @@ end
--------------------------------------------------------------------
+local actions = {};
+
+function actions.load(params)
+ --return true, "Module loaded ("..params.module.." on "..params.host..")";
+ return load(params.host, params.module);
+end
+
+function actions.unload(params)
+ return unload(params.host, params.module);
+end
+
+register_actions("/modules", actions);
+
return _M;