Changeset

2358:f96b947303a2

mod_proxy65_whitelist: Only add proxy hosts enabled after module is loaded if allow_local_streamhosts = true
author Kim Alvefur <zash@zash.se>
date Wed, 09 Nov 2016 14:11:16 +0100
parents 2357:093b70378fa5
children 2359:33e85070dc60
files mod_proxy65_whitelist/mod_proxy65_whitelist.lua
diffstat 1 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- 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;