diff options
author | daurnimator <quae@daurnimator.com> | 2014-09-05 11:19:16 -0400 |
---|---|---|
committer | daurnimator <quae@daurnimator.com> | 2014-09-05 11:19:16 -0400 |
commit | aa51ed52ec4359dd1c47f9025b78ab00c985cba9 (patch) | |
tree | 19c4c84148090f29a4a1546801289a50a81f2f08 | |
parent | c7935f64ff5e6da9aaa4f6518c1a167b981e2133 (diff) | |
download | prosody-aa51ed52ec4359dd1c47f9025b78ab00c985cba9.tar.gz prosody-aa51ed52ec4359dd1c47f9025b78ab00c985cba9.zip |
plugins/muc/muc.lib: Add instant room support
-rw-r--r-- | plugins/muc/muc.lib.lua | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/plugins/muc/muc.lib.lua b/plugins/muc/muc.lib.lua index 041187e5..d430f984 100644 --- a/plugins/muc/muc.lib.lua +++ b/plugins/muc/muc.lib.lua @@ -614,10 +614,15 @@ function room_mt:process_form(origin, stanza) if form.attr.type == "cancel" then origin.send(st.reply(stanza)); elseif form.attr.type == "submit" then - local fields = self:get_form_layout(stanza.attr.from):data(form); - if fields.FORM_TYPE ~= "http://jabber.org/protocol/muc#roomconfig" then - origin.send(st.error_reply(stanza, "cancel", "bad-request", "Form is not of type room configuration")); - return true; + local fields; + if form.tags[1] == nil then -- Instant room + fields = {}; + else + fields = self:get_form_layout(stanza.attr.from):data(form); + if fields.FORM_TYPE ~= "http://jabber.org/protocol/muc#roomconfig" then + origin.send(st.error_reply(stanza, "cancel", "bad-request", "Form is not of type room configuration")); + return true; + end end local event = {room = self; origin = origin; stanza = stanza; fields = fields; status_codes = {};}; |