mod_proxy65_whitelist: Only add proxy hosts enabled after module is loaded if allow_local_streamhosts = true
authorKim Alvefur <zash@zash.se>
Wed, 09 Nov 2016 14:11:16 +0100
changeset 2362 f96b947303a2
parent 2361 093b70378fa5
child 2363 33e85070dc60
mod_proxy65_whitelist: Only add proxy hosts enabled after module is loaded if allow_local_streamhosts = true
mod_proxy65_whitelist/mod_proxy65_whitelist.lua
--- a/mod_proxy65_whitelist/mod_proxy65_whitelist.lua	Wed Nov 09 13:38:44 2016 +0100
+++ b/mod_proxy65_whitelist/mod_proxy65_whitelist.lua	Wed Nov 09 14:11:16 2016 +0100
@@ -6,14 +6,14 @@
 			allowed_streamhosts:add(hostname);
 		end
 	end
+
+	module:hook_global("host-activated", function (host)
+		if hosts[host].modules.proxy65 then
+			allowed_streamhosts:add(host);
+		end
+	end);
 end
 
-module:hook_global("host-activated", function (host)
-	if hosts[host].modules.proxy65 then
-		allowed_streamhosts:add(host);
-	end
-end);
-
 local function filter_streamhosts(tag)
 	if tag.name == "streamhost" and not allowed_streamhosts:contains(tag.attr.jid) then
 		return nil;