core.stanza_router: Remove compatibility with Jabiru not including id attribute ...
[prosody.git] / core / stanza_router.lua
index 4f529129d91ce121f261f696d554db17e2004acc..fb30eef5a6971e4d74905d8c52cace5d5d3fba2b 100644 (file)
@@ -30,7 +30,7 @@ deprecated_warning"core_process_stanza";
 deprecated_warning"core_route_stanza";
 
 local valid_stanzas = { message = true, presence = true, iq = true };
-local function handle_unhandled_stanza(host, origin, stanza)
+local function handle_unhandled_stanza(host, origin, stanza) --luacheck: ignore 212/host
        local name, xmlns, origin_type = stanza.name, stanza.attr.xmlns or "jabber:client", origin.type;
        if xmlns == "jabber:client" and valid_stanzas[name] then
                -- A normal stanza
@@ -62,8 +62,7 @@ function core_process_stanza(origin, stanza)
                        return handle_unhandled_stanza(origin.host, 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
@@ -221,6 +220,8 @@ function core_route_stanza(origin, stanza)
                end
        end
 end
+
+--luacheck: ignore 122/prosody
 prosody.core_process_stanza = core_process_stanza;
 prosody.core_post_stanza = core_post_stanza;
 prosody.core_route_stanza = core_route_stanza;