# HG changeset patch # User daurnimator # Date 1409930356 14400 # Node ID 4d334d00c63568a6caa960a8ce005f952ffdca1e # Parent 6bd67fba61394fa0cd38ce5c06606f899089c661 plugins/muc/muc.lib: Add instant room support diff -r 6bd67fba6139 -r 4d334d00c635 plugins/muc/muc.lib.lua --- a/plugins/muc/muc.lib.lua Fri Sep 05 09:04:37 2014 +0100 +++ b/plugins/muc/muc.lib.lua Fri Sep 05 11:19:16 2014 -0400 @@ -614,10 +614,15 @@ 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 = {};};