Merge 0.9->0.10
authorKim Alvefur <zash@zash.se>
Tue, 19 Apr 2016 15:30:30 +0000 (17:30 +0200)
committerKim Alvefur <zash@zash.se>
Tue, 19 Apr 2016 15:30:30 +0000 (17:30 +0200)
net/server_event.lua
plugins/muc/muc.lib.lua

index 2edc9a0c30c5c6dbecb980f436f43ad2919172bf..a67d5afb83dd22371fd6fb95939a426c956bb30a 100644 (file)
@@ -521,6 +521,10 @@ local function handleclient( client, ip, port, server, pattern, listener, sslctx
                                elseif interface.eventreadtimeout then
                                        return EV_WRITE, EV_TIMEOUT
                                end
+                               if interface.writebuffer ~= 0 then
+                                       -- data possibly written from ondrain
+                                       return EV_WRITE, cfg.WRITE_TIMEOUT
+                               end
                                interface.eventwrite = nil
                                return -1
                        elseif byte and (err == "timeout" or err == "wantwrite") then  -- want write again
index 552b9e49970a5e6e5f950d6b598316d6d65008dc..88ee43c1f4ac0ed0cafef209519169705a437b43 100644 (file)
@@ -681,6 +681,13 @@ 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, 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"));