diff options
author | Matthew Wild <mwild1@gmail.com> | 2012-05-11 01:39:52 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2012-05-11 01:39:52 +0100 |
commit | 5a95f10b210e59072916230230ee260eca3dd551 (patch) | |
tree | e46e85804933a17809fc6952f1b1f95f70583dd3 /plugins | |
parent | a773a23715f2c60b566ddf290f123fcd9c3d1bae (diff) | |
download | prosody-5a95f10b210e59072916230230ee260eca3dd551.tar.gz prosody-5a95f10b210e59072916230230ee260eca3dd551.zip |
Backed out changeset 9f1fb34cd7f8 - obsoleted by 5ef05f32bc42.
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/mod_dialback.lua | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/plugins/mod_dialback.lua b/plugins/mod_dialback.lua index f3b9e3cf..5d32fdb2 100644 --- a/plugins/mod_dialback.lua +++ b/plugins/mod_dialback.lua @@ -76,27 +76,21 @@ module:hook("stanza/jabber:server:dialback:result", function(event) dialback_requests[attr.from.."/"..origin.streamid] = origin; - local compat_check; if not origin.from_host then -- Just used for friendlier logging origin.from_host = nameprep(attr.from); - -- COMPAT: Fix server's chopness by not including from - compat_check = true; + -- COMPAT: Fix ejabberd chopness by resetting the send function + if not origin.from_host then + origin.log("debug", "We need to know where to connect but remote server blindly refuses to tell us and to comply to specs, closing connection."); + origin:close("invalid-from"); + else + origin.log("debug", "Remote server didn't specify a from attr, resetting session.send now that we know where to knock to."); + origin.send = function(stanza) hosts[attr.to].events.fire_event("route/remote", { from_host = origin.to_host, to_host = origin.from_host, stanza = stanza}); end + end end if not origin.to_host then -- Just used for friendlier logging - origin.to_host = nameprep(attr.to); - -- COMPAT: Fix server's chopness by not including to - compat_check = true; - end - - if not origin.from_host and not origin.to_host then - origin.log("debug", "Improper addressing supplied, no to or from?"); - origin:close("improper-addressing"); - end - -- COMPAT: reset session.send - if compat_check then - origin.send = function(stanza) hosts[attr.to].events.fire_event("route/remote", { from_host = origin.to_host, to_host = origin.from_host, stanza = stanza}); end + origin.to_host = attr.to; end origin.log("debug", "asking %s if key %s belongs to them", attr.from, stanza[1]); |