From e040b9ed53ceca90376dcf3faa34eb460e496608 Mon Sep 17 00:00:00 2001 From: Waqas Hussain Date: Mon, 7 Sep 2009 20:29:04 +0500 Subject: MUC: Added support for generating unique room names --- plugins/muc/mod_muc.lua | 3 +++ 1 file changed, 3 insertions(+) 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 -- cgit v1.2.3