X-Git-Url: https://git.enpas.org/?a=blobdiff_plain;ds=sidebyside;f=core%2Fstanza_router.lua;h=55c94bf4b51261ebf897f238c3de0c9cede45c3e;hb=550b468d8b1293ad7c45370cd2fd249a53894a36;hp=dbbb299b1d0752b21df390ebaca5df14d1aa85ae;hpb=ad00f8769f2110e42bb7a7ce83b952abddc0aa19;p=prosody.git diff --git a/core/stanza_router.lua b/core/stanza_router.lua index dbbb299b..55c94bf4 100644 --- a/core/stanza_router.lua +++ b/core/stanza_router.lua @@ -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 @@ -46,7 +46,7 @@ local function handle_unhandled_stanza(host, origin, stanza) if origin.send then origin.send(st.error_reply(stanza, "cancel", "service-unavailable")); end - elseif not((name == "features" or name == "error") and xmlns == "http://etherx.jabber.org/streams") then -- FIXME remove check once we handle S2S features + else log("warn", "Unhandled %s stream element or stanza: %s; xmlns=%s: %s", origin_type, name, xmlns, tostring(stanza)); -- we didn't handle it origin:close("unsupported-stanza-type"); end @@ -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 @@ -221,6 +221,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;