1 -- XEP-0307: Unique Room Names for Multi-User Chat
2 local st
= require
"util.stanza";
3 local unique_name
= require
"util.id".medium
;
4 module
:add_feature
"http://jabber.org/protocol/muc#unique"
5 module
:hook("iq-get/host/http://jabber.org/protocol/muc#unique:unique", function(event
)
6 local origin
, stanza
= event
.origin
, event
.stanza
;
7 origin
.send(st
.reply(stanza
)
8 :tag("unique", {xmlns
= "http://jabber.org/protocol/muc#unique"})
9 :text(unique_name():lower())