Software /
code /
prosody
Diff
plugins/muc/mod_muc.lua @ 1741:2919f3b985fc
MUC: Added support for generating unique room names
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Mon, 07 Sep 2009 20:29:04 +0500 |
parent | 1738:ee4a7151ed07 |
child | 1747:28e5f6b535a8 |
line wrap: on
line diff
--- a/plugins/muc/mod_muc.lua Mon Sep 07 20:27:52 2009 +0500 +++ b/plugins/muc/mod_muc.lua Mon Sep 07 20:29:04 2009 +0500 @@ -20,6 +20,7 @@ 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 @@ 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