core.stanza_router: Rename variable to be more specific
authorKim Alvefur <zash@zash.se>
Fri, 25 Jun 2021 15:17:37 +0200
changeset 11633 e6e56e2dd996
parent 11632 0807e835d3b5
child 11634 855b065d5fd6
core.stanza_router: Rename variable to be more specific
core/stanza_router.lua
--- a/core/stanza_router.lua	Mon Jun 21 22:43:26 2021 +0200
+++ b/core/stanza_router.lua	Fri Jun 25 15:17:37 2021 +0200
@@ -194,14 +194,14 @@
 end
 
 function core_route_stanza(origin, stanza)
-	local host = jid_host(stanza.attr.to);
+	local to_host = jid_host(stanza.attr.to);
 	local from_host = jid_host(stanza.attr.from);
 
 	-- Auto-detect origin if not specified
 	origin = origin or hosts[from_host];
 	if not origin then return false; end
 
-	if hosts[host] then
+	if hosts[to_host] then
 		-- old stanza routing code removed
 		core_post_stanza(origin, stanza);
 	else
@@ -212,7 +212,7 @@
 			local xmlns = stanza.attr.xmlns;
 			stanza.attr.xmlns = nil;
 			local routed = host_session.events.fire_event("route/remote", {
-				origin = origin, stanza = stanza, from_host = from_host, to_host = host });
+				origin = origin, stanza = stanza, from_host = from_host, to_host = to_host });
 			stanza.attr.xmlns = xmlns; -- reset
 			if not routed then
 				log("debug", "Could not route stanza to remote");