aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/muc
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2015-12-08 20:19:30 +0100
committerKim Alvefur <zash@zash.se>2015-12-08 20:19:30 +0100
commit9305ea7d234c19ccdb938259bb8301c732a8366c (patch)
treea007e360cc644c038e60aa6f30f9f9dd62378732 /plugins/muc
parent76cc2a0c008f2c0829c70428969830198ff3303e (diff)
downloadprosody-9305ea7d234c19ccdb938259bb8301c732a8366c.tar.gz
prosody-9305ea7d234c19ccdb938259bb8301c732a8366c.zip
MUC: Process only options that are included in a form (Fixes #521)
Diffstat (limited to 'plugins/muc')
-rw-r--r--plugins/muc/muc.lib.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/plugins/muc/muc.lib.lua b/plugins/muc/muc.lib.lua
index 48231c37..20e91192 100644
--- a/plugins/muc/muc.lib.lua
+++ b/plugins/muc/muc.lib.lua
@@ -674,7 +674,7 @@ function room_mt:process_form(origin, stanza)
if form.attr.type == "cancel" then origin.send(st.reply(stanza)); return; end
if form.attr.type ~= "submit" then origin.send(st.error_reply(stanza, "cancel", "bad-request", "Not a submitted form")); return; end
- local fields = self:get_form_layout(stanza.attr.from):data(form);
+ local fields, errors, present = 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;
@@ -683,8 +683,8 @@ function room_mt:process_form(origin, stanza)
local changed = {};
local function handle_option(name, field, allowed)
- local new = fields[field];
- if new == nil then return; end
+ local new, err, included = fields[field], errors[field], present[field];
+ if not included then return; end
if allowed and not allowed[new] then return; end
if new == self["get_"..name](self) then return; end
changed[name] = true;