diff options
author | Matthew Wild <mwild1@gmail.com> | 2009-01-29 17:54:37 +0000 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2009-01-29 17:54:37 +0000 |
commit | 4dc046b0afa381ac22982bd1d4265775832c4553 (patch) | |
tree | 808a534fe9e3bc2cfadb1ea6bb7bacea05277631 /plugins | |
parent | 8fc233d7f5e6a5bee04d6b26a761ac2f9f88e57d (diff) | |
parent | 75a4fe601018e84510f1526faa9d155a9299e528 (diff) | |
download | prosody-4dc046b0afa381ac22982bd1d4265775832c4553.tar.gz prosody-4dc046b0afa381ac22982bd1d4265775832c4553.zip |
Automated merge with http://waqas.ath.cx:8000/
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/mod_muc.lua | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/plugins/mod_muc.lua b/plugins/mod_muc.lua index f1b46eed..0b610835 100644 --- a/plugins/mod_muc.lua +++ b/plugins/mod_muc.lua @@ -8,7 +8,12 @@ local st = require "util.stanza"; local log = require "util.logger".init("mod_muc");
local multitable_new = require "util.multitable".new;
-local muc_domain = "conference."..module:get_host();
+if module:get_host_type() ~= "component" then
+ error("MUC should be loaded as a component, please see http://prosody.im/doc/components", 0);
+end
+
+local muc_domain = module:get_host();
+
local muc_name = "MUCMUCMUC!!!";
-- room_name -> room
@@ -256,7 +261,7 @@ function handle_to_domain(origin, stanza) end
end
-component = register_component(muc_domain, function(origin, stanza)
+function handle_stanza(origin, stanza)
local to_node, to_host, to_resource = jid_split(stanza.attr.to);
if stanza.name == "presence" and stanza.attr.type ~= nil and stanza.attr.type ~= "unavailable" then
if type == "error" or type == "result" then return; end
@@ -272,7 +277,11 @@ component = register_component(muc_domain, function(origin, stanza) if type == "error" or type == "result" then return; end
handle_to_domain(origin, stanza);
end
-end);
+end
+
+module.load_component = function()
+ return handle_stanza; -- Return the function that we want to handle incoming stanzas
+end
module.unload = function()
deregister_component(muc_domain);
|