Diff

plugins/mod_dialback.lua @ 4316:2478698bdc52

Merge 0.8->trunk
author Matthew Wild <mwild1@gmail.com>
date Tue, 07 Jun 2011 01:29:34 +0100
parent 4264:fa36e749749c
parent 4314:1e1110840965
child 4567:24617f360200
line wrap: on
line diff
--- a/plugins/mod_dialback.lua	Sun Jun 05 23:55:16 2011 +0100
+++ b/plugins/mod_dialback.lua	Tue Jun 07 01:29:34 2011 +0100
@@ -60,7 +60,7 @@
 			return true;
 		end
 		
-		dialback_requests[attr.from] = origin;
+		dialback_requests[attr.from.."/"..origin.streamid] = origin;
 		
 		if not origin.from_host then
 			-- Just used for friendlier logging
@@ -83,8 +83,8 @@
 	
 	if origin.type == "s2sout_unauthed" or origin.type == "s2sout" then
 		local attr = stanza.attr;
-		local dialback_verifying = dialback_requests[attr.from];
-		if dialback_verifying then
+		local dialback_verifying = dialback_requests[attr.from.."/"..(attr.id or "")];
+		if dialback_verifying and attr.from == origin.to_host then
 			local valid;
 			if attr.type == "valid" then
 				s2s_make_authenticated(dialback_verifying, attr.from);
@@ -101,7 +101,7 @@
 						st.stanza("db:result", { from = attr.to, to = attr.from, id = attr.id, type = valid })
 								:text(dialback_verifying.hosts[attr.from].dialback_key));
 			end
-			dialback_requests[attr.from] = nil;
+			dialback_requests[attr.from.."/"..(attr.id or "")] = nil;
 		end
 		return true;
 	end