comparison mod_proxy65_whitelist/mod_proxy65_whitelist.lua @ 2349:48686b399a88

mod_proxy65_whitelist: Add proxy hosts enabled after module is loaded (fixes #494)
author Kim Alvefur <zash@zash.se>
date Mon, 07 Nov 2016 17:35:11 +0100
parents 4ef0a1a499fa
children 67990e045d4f
comparison
equal deleted inserted replaced
2348:1903add39b7c 2349:48686b399a88
5 if host.modules.proxy65 then 5 if host.modules.proxy65 then
6 allowed_streamhosts:add(hostname); 6 allowed_streamhosts:add(hostname);
7 end 7 end
8 end 8 end
9 end 9 end
10
11 module:hook_global("host-activated", function (host)
12 if hosts[host].modules.proxy65 then
13 allowed_streamhosts:add(host);
14 end
15 end);
10 16
11 local function filter_streamhosts(tag) 17 local function filter_streamhosts(tag)
12 if tag.name == "streamhost" and not allowed_streamhosts:contains(tag.attr.jid) then 18 if tag.name == "streamhost" and not allowed_streamhosts:contains(tag.attr.jid) then
13 return nil; 19 return nil;
14 end 20 end