comparison mod_block_outgoing/mod_block_outgoing.lua @ 2006:cb810a2bca47

mod_block_outgoing: Allow stanzas to user's login host (e.g. disco queries)
author Matthew Wild <mwild1@gmail.com>
date Wed, 13 Jan 2016 16:10:27 +0000
parents c769ed3e5b2b
children dc1299ca0185
comparison
equal deleted inserted replaced
2005:c769ed3e5b2b 2006:cb810a2bca47
10 local jid_types = { "host", "bare", "full" }; 10 local jid_types = { "host", "bare", "full" };
11 11
12 local function block_stanza(event) 12 local function block_stanza(event)
13 local stanza = event.stanza; 13 local stanza = event.stanza;
14 local from_jid = jid_bare(stanza.attr.from); 14 local from_jid = jid_bare(stanza.attr.from);
15 if stanza.attr.to == nil or is_admin(from_jid, module.host) then 15 if stanza.attr.to == nil or stanza.attr.to == module.host or is_admin(from_jid, module.host) then
16 return; 16 return;
17 end 17 end
18 if block_all or block_users:contains(from_jid) then 18 if block_all or block_users:contains(from_jid) then
19 module:log("debug", "Blocked outgoing %s stanza from %s", stanza.name, stanza.attr.from); 19 module:log("debug", "Blocked outgoing %s stanza from %s", stanza.name, stanza.attr.from);
20 return true; 20 return true;