MUC: Accept missing form as "instant room" request (fixes #377)
authorKim Alvefur <zash@zash.se>
Tue, 19 Apr 2016 15:20:39 +0000 (17:20 +0200)
committerKim Alvefur <zash@zash.se>
Tue, 19 Apr 2016 15:20:39 +0000 (17:20 +0200)
plugins/muc/muc.lib.lua

index 5879c256c36f1f04bf9090a037a0e5dbae0205fe..f8e8f74dcfe7026dc1df765d846a9be1dbe76634 100644 (file)
@@ -668,6 +668,14 @@ 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
 
+       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