aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2014-09-05 11:19:16 -0400
committerdaurnimator <quae@daurnimator.com>2014-09-05 11:19:16 -0400
commit136d5aee859f4b064efb6618fa0de99e491bd271 (patch)
tree19c4c84148090f29a4a1546801289a50a81f2f08 /plugins
parent1fe68a4d1d213928ced691508d12353a3de8c52f (diff)
downloadprosody-136d5aee859f4b064efb6618fa0de99e491bd271.tar.gz
prosody-136d5aee859f4b064efb6618fa0de99e491bd271.zip
plugins/muc/muc.lib: Add instant room support
Diffstat (limited to 'plugins')
-rw-r--r--plugins/muc/muc.lib.lua13
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 = {};};