Comparison

plugins/muc/muc.lib.lua @ 7385:17929cdacec2

Merge 0.9->0.10
author Kim Alvefur <zash@zash.se>
date Tue, 19 Apr 2016 17:30:30 +0200
parent 7118:dacc07833b86
parent 7383:69827ee1f951
child 7386:5a9af30d5737
child 7443:4a178edc9847
comparison
equal deleted inserted replaced
7381:a05bf94646ba 7385:17929cdacec2
678 local form; 678 local form;
679 for _, tag in ipairs(query.tags) do if tag.name == "x" and tag.attr.xmlns == "jabber:x:data" then form = tag; break; end end 679 for _, tag in ipairs(query.tags) do if tag.name == "x" and tag.attr.xmlns == "jabber:x:data" then form = tag; break; end end
680 if not form then origin.send(st.error_reply(stanza, "cancel", "service-unavailable")); return; end 680 if not form then origin.send(st.error_reply(stanza, "cancel", "service-unavailable")); return; end
681 if form.attr.type == "cancel" then origin.send(st.reply(stanza)); return; end 681 if form.attr.type == "cancel" then origin.send(st.reply(stanza)); return; end
682 if form.attr.type ~= "submit" then origin.send(st.error_reply(stanza, "cancel", "bad-request", "Not a submitted form")); return; end 682 if form.attr.type ~= "submit" then origin.send(st.error_reply(stanza, "cancel", "bad-request", "Not a submitted form")); return; end
683
684 if form.tags[1] == nil then
685 -- instant room
686 if self.save then self:save(true); end
687 origin.send(st.reply(stanza));
688 return true;
689 end
683 690
684 local fields, errors, present = self:get_form_layout(stanza.attr.from):data(form); 691 local fields, errors, present = self:get_form_layout(stanza.attr.from):data(form);
685 if fields.FORM_TYPE ~= "http://jabber.org/protocol/muc#roomconfig" then 692 if fields.FORM_TYPE ~= "http://jabber.org/protocol/muc#roomconfig" then
686 origin.send(st.error_reply(stanza, "cancel", "bad-request", "Form is not of type room configuration")); 693 origin.send(st.error_reply(stanza, "cancel", "bad-request", "Form is not of type room configuration"));
687 return; 694 return;