aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/muc
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
commitaa51ed52ec4359dd1c47f9025b78ab00c985cba9 (patch)
tree19c4c84148090f29a4a1546801289a50a81f2f08 /plugins/muc
parentc7935f64ff5e6da9aaa4f6518c1a167b981e2133 (diff)
downloadprosody-aa51ed52ec4359dd1c47f9025b78ab00c985cba9.tar.gz
prosody-aa51ed52ec4359dd1c47f9025b78ab00c985cba9.zip
plugins/muc/muc.lib: Add instant room support
Diffstat (limited to 'plugins/muc')
-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 = {};};