plugins/muc/muc.lib.lua
changeset 7386 69827ee1f951
parent 7014 2d5751b2f21c
child 7388 17929cdacec2
child 8468 0ec72e67f797
equal deleted inserted replaced
7331:de76ded98b84 7386:69827ee1f951
   665 	local form;
   665 	local form;
   666 	for _, tag in ipairs(query.tags) do if tag.name == "x" and tag.attr.xmlns == "jabber:x:data" then form = tag; break; end end
   666 	for _, tag in ipairs(query.tags) do if tag.name == "x" and tag.attr.xmlns == "jabber:x:data" then form = tag; break; end end
   667 	if not form then origin.send(st.error_reply(stanza, "cancel", "service-unavailable")); return; end
   667 	if not form then origin.send(st.error_reply(stanza, "cancel", "service-unavailable")); return; end
   668 	if form.attr.type == "cancel" then origin.send(st.reply(stanza)); return; end
   668 	if form.attr.type == "cancel" then origin.send(st.reply(stanza)); return; end
   669 	if form.attr.type ~= "submit" then origin.send(st.error_reply(stanza, "cancel", "bad-request", "Not a submitted form")); return; end
   669 	if form.attr.type ~= "submit" then origin.send(st.error_reply(stanza, "cancel", "bad-request", "Not a submitted form")); return; end
       
   670 
       
   671 	if form.tags[1] == nil then
       
   672 		-- instant room
       
   673 		if self.save then self:save(true); end
       
   674 		origin.send(st.reply(stanza));
       
   675 		return true;
       
   676 	end
       
   677 
   670 
   678 
   671 	local fields = self:get_form_layout():data(form);
   679 	local fields = self:get_form_layout():data(form);
   672 	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; end
   680 	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; end
   673 
   681 
   674 	local dirty = false
   682 	local dirty = false