aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2009-09-07 20:29:04 +0500
committerWaqas Hussain <waqas20@gmail.com>2009-09-07 20:29:04 +0500
commite040b9ed53ceca90376dcf3faa34eb460e496608 (patch)
treef50d9772a2f3572aca9c1bcc85f593d7c4e28e74 /plugins
parent8959db9d938213be969bbe5cdedca825be253d6e (diff)
downloadprosody-e040b9ed53ceca90376dcf3faa34eb460e496608.tar.gz
prosody-e040b9ed53ceca90376dcf3faa34eb460e496608.zip
MUC: Added support for generating unique room names
Diffstat (limited to 'plugins')
-rw-r--r--plugins/muc/mod_muc.lua3
1 files changed, 3 insertions, 0 deletions
diff --git a/plugins/muc/mod_muc.lua b/plugins/muc/mod_muc.lua
index b0419a8e..4a8263ce 100644
--- a/plugins/muc/mod_muc.lua
+++ b/plugins/muc/mod_muc.lua
@@ -20,6 +20,7 @@ local register_component = require "core.componentmanager".register_component;
local deregister_component = require "core.componentmanager".deregister_component;
local jid_split = require "util.jid".split;
local st = require "util.stanza";
+local uuid_gen = require "util.uuid".generate;
local rooms = {};
local component;
@@ -48,6 +49,8 @@ local function handle_to_domain(origin, stanza)
origin.send(get_disco_info(stanza));
elseif xmlns == "http://jabber.org/protocol/disco#items" then
origin.send(get_disco_items(stanza));
+ elseif xmlns == "http://jabber.org/protocol/muc#unique" then
+ origin.send(st.reply(stanza):tag("unique", {xmlns = xmlns}):text(uuid_gen())); -- FIXME Random UUIDs can theoretically have collisions
else
origin.send(st.error_reply(stanza, "cancel", "service-unavailable")); -- TODO disco/etc
end