mod_csi_simple: Consider messages encrypted payload as important (fixes part of ...
[prosody.git] / plugins / mod_muc_unique.lua
blob13284745ffcdfa92848a18a971c1e8ede6c9d0cd
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())
11 return true;
12 end,-1);