Created
January 6, 2015 09:03
-
-
Save neocturne/3923e1327ae8a9f32b49 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -r 0da51b825263 mod_onions/mod_onions.lua | |
--- a/mod_onions/mod_onions.lua Sat Dec 20 21:56:13 2014 +0100 | |
+++ b/mod_onions/mod_onions.lua Tue Jan 06 10:02:40 2015 +0100 | |
@@ -195,6 +195,7 @@ | |
host_session.conn = conn; | |
end | |
+local bouncy_stanzas = { message = true, presence = true, iq = true }; | |
local function bounce_sendq(session, reason) | |
local sendq = session.sendq; | |
if not sendq then return; end | |
@@ -208,7 +209,7 @@ | |
}; | |
for i, data in ipairs(sendq) do | |
local reply = data[2]; | |
- if reply and not(reply.attr.xmlns) then | |
+ if reply and not(reply.attr.xmlns) and bouncy_stanzas[reply.name] then | |
reply.attr.type = "error"; | |
reply:tag("error", {type = "cancel"}) | |
:tag("remote-server-not-found", {xmlns = "urn:ietf:params:xml:ns:xmpp-stanzas"}):up(); | |
@@ -216,7 +217,7 @@ | |
reply:tag("text", {xmlns = "urn:ietf:params:xml:ns:xmpp-stanzas"}) | |
:text("Server-to-server connection failed: "..reason):up(); | |
end | |
- core_process_stanza(dummy, reply); | |
+ prosody.core_process_stanza(dummy, reply); | |
end | |
sendq[i] = nil; | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment