Changeset

7383:69827ee1f951

MUC: Accept missing form as "instant room" request (fixes #377)
author Kim Alvefur <zash@zash.se>
date Tue, 19 Apr 2016 17:20:39 +0200
parents 7328:de76ded98b84
children 7384:65abd9d7bf88
files plugins/muc/muc.lib.lua
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/muc/muc.lib.lua	Sun Apr 03 15:18:21 2016 +0200
+++ b/plugins/muc/muc.lib.lua	Tue Apr 19 17:20:39 2016 +0200
@@ -668,6 +668,14 @@
 	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
 
+	if form.tags[1] == nil then
+		-- instant room
+		if self.save then self:save(true); end
+		origin.send(st.reply(stanza));
+		return true;
+	end
+
+
 	local fields = self:get_form_layout():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; end