From 136d5aee859f4b064efb6618fa0de99e491bd271 Mon Sep 17 00:00:00 2001 From: daurnimator Date: Fri, 5 Sep 2014 11:19:16 -0400 Subject: plugins/muc/muc.lib: Add instant room support --- plugins/muc/muc.lib.lua | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'plugins/muc') 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 = {};}; -- cgit v1.2.3