stanza_router: Fix routing of 'error' IQs with multiple childs (thanks Pawel)
authorKim Alvefur <zash@zash.se>
Tue, 6 Jan 2015 16:39:47 +0000 (17:39 +0100)
committerKim Alvefur <zash@zash.se>
Tue, 6 Jan 2015 16:39:47 +0000 (17:39 +0100)
core/stanza_router.lua

index bf5b11bc35ec447af9d22b543448dab20e179343..a2c7b3963abfba49273e12de367aebb864e28ade 100644 (file)
@@ -63,7 +63,7 @@ function core_process_stanza(origin, stanza)
                end
                if name == "iq" then
                        if not stanza.attr.id then stanza.attr.id = ""; end -- COMPAT Jabiru doesn't send the id attribute on roster requests
-                       if not iq_types[st_type] or (st_type ~= "result" and #stanza.tags ~= 1) then
+                       if not iq_types[st_type] or ((st_type == "set" or st_type == "get") and (#stanza.tags ~= 1)) then
                                origin.send(st.error_reply(stanza, "modify", "bad-request", "Invalid IQ type or incorrect number of children"));
                                return;
                        end