Mercurial > prosody-modules
view mod_proxy65_whitelist/mod_proxy65_whitelist.lua @ 2209:2733cb8c82a9
mod_statistics: Add 'statistics_meminfo_interval' option to control the number of seconds between calls to mallinfo(). Between calls, cached results are used.
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Mon, 13 Jun 2016 13:15:07 +0100 |
parents | 4ef0a1a499fa |
children | 48686b399a88 |
line wrap: on
line source
local allowed_streamhosts = module:get_option_set("allowed_streamhosts", {}); -- eg proxy.eu.jabber.org if module:get_option_boolean("allow_local_streamhosts", true) then for hostname, host in pairs(hosts) do if host.modules.proxy65 then allowed_streamhosts:add(hostname); end end end local function filter_streamhosts(tag) if tag.name == "streamhost" and not allowed_streamhosts:contains(tag.attr.jid) then return nil; end return tag; end module:hook("iq/full", function (event) local stanza, origin = event.stanza, event.origin; if stanza.attr.type == "set" then local payload = stanza:get_child("query", "http://jabber.org/protocol/bytestreams"); if payload then payload:maptags(filter_streamhosts); end end end, 1);