Merge with backout
authorMatthew Wild <mwild1@gmail.com>
Fri, 11 May 2012 00:45:36 +0000 (01:45 +0100)
committerMatthew Wild <mwild1@gmail.com>
Fri, 11 May 2012 00:45:36 +0000 (01:45 +0100)
1  2 
plugins/mod_dialback.lua

index 8c683d8a8f5caf552d4705c588f172d94d7c22ac,5d32fdb2f76392d18f70d11ecbe56e863b418389..4b19f2d924cd01f7082200187a5aa7919c58a098
@@@ -76,10 -76,17 +76,14 @@@ module:hook("stanza/jabber:server:dialb
                
                dialback_requests[attr.from.."/"..origin.streamid] = origin;
                
 +              local compat_check;
                if not origin.from_host then
                        -- Just used for friendlier logging
-                       origin.from_host = attr.from;
+                       origin.from_host = nameprep(attr.from);
 -                      -- 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