diff options
author | Waqas Hussain <waqas20@gmail.com> | 2009-01-07 20:02:49 +0500 |
---|---|---|
committer | Waqas Hussain <waqas20@gmail.com> | 2009-01-07 20:02:49 +0500 |
commit | 311a737c2c08cd52b4ba554c4e168fe114581730 (patch) | |
tree | 3a807d921dc49e230ee29c3b4972c09d90d0522b /core | |
parent | 430276629fba39232a2e211c626b8736712a8e54 (diff) | |
download | prosody-311a737c2c08cd52b4ba554c4e168fe114581730.tar.gz prosody-311a737c2c08cd52b4ba554c4e168fe114581730.zip |
componentmanager: Added support for component deregistering
Diffstat (limited to 'core')
-rw-r--r-- | core/componentmanager.lua | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/core/componentmanager.lua b/core/componentmanager.lua index 72cdda14..afed1df3 100644 --- a/core/componentmanager.lua +++ b/core/componentmanager.lua @@ -21,7 +21,8 @@ local log = require "util.logger".init("componentmanager"); -local module_load = require "core.modulemanager".load;
+local module_load = require "core.modulemanager".load; +local module_unload = require "core.modulemanager".unload;
local jid_split = require "util.jid".split;
local hosts = hosts;
@@ -56,5 +57,17 @@ function register_component(host, component) log("error", "Attempt to set component for existing host: "..host);
end
end
+ +function deregister_component(host, component) + if components[host] then + module_unload(host, "dialback"); + components[host] = nil; + hosts[host] = nil; + log("debug", "component removed: "..host); + return true; + else + log("error", "Attempt to remove component for non-existing host: "..host); + end +end return _M;
|