# HG changeset patch # User Waqas Hussain # Date 1243853319 -18000 # Node ID 0e700e2041eff36a8f587368fdcde0a11e67fcb2 # Parent b06d6674477b54982d1e65fbf214753858294719 stanza_router: Don't reply with an error on invalid JIDs in error or result stanzas diff -r b06d6674477b -r 0e700e2041ef core/stanza_router.lua --- a/core/stanza_router.lua Mon Jun 01 15:09:42 2009 +0500 +++ b/core/stanza_router.lua Mon Jun 01 15:48:39 2009 +0500 @@ -81,7 +81,9 @@ node, host, resource = jid_prepped_split(to); if not host then log("warn", "Received stanza with invalid destination JID: %s", to); - origin.send(st.error_reply(stanza, "modify", "jid-malformed", "The destination address is invalid: "..to)); + if stanza.attr.type ~= "error" and stanza.attr.type ~= "result" then + origin.send(st.error_reply(stanza, "modify", "jid-malformed", "The destination address is invalid: "..to)); + end return; end to_bare = node and (node.."@"..host) or host; -- bare JID @@ -93,7 +95,9 @@ from_node, from_host, from_resource = jid_prepped_split(from); if not from_host then log("warn", "Received stanza with invalid source JID: %s", from); - origin.send(st.error_reply(stanza, "modify", "jid-malformed", "The source address is invalid: "..from)); + if stanza.attr.type ~= "error" and stanza.attr.type ~= "result" then + origin.send(st.error_reply(stanza, "modify", "jid-malformed", "The source address is invalid: "..from)); + end return; end from_bare = from_node and (from_node.."@"..from_host) or from_host; -- bare JID