comparison mod_host_blacklist/mod_host_blacklist.lua @ 1182:547b3c05cc06

mod_host_blacklist: Bigger fix: return true to block original stanza (thanks Zash)
author Matthew Wild <mwild1@gmail.com>
date Tue, 03 Sep 2013 11:19:31 +0100
parents 005b0429cf46
children
comparison
equal deleted inserted replaced
1181:005b0429cf46 1182:547b3c05cc06
8 local function stanza_checker(attr) 8 local function stanza_checker(attr)
9 return function (event) 9 return function (event)
10 local host = select(2, jid_split(event.stanza.attr[attr])); 10 local host = select(2, jid_split(event.stanza.attr[attr]));
11 if blacklist:contains(host) then 11 if blacklist:contains(host) then
12 module:send(st.error_reply(event.stanza, "cancel", "not-allowed", "Communication with this domain is restricted")); 12 module:send(st.error_reply(event.stanza, "cancel", "not-allowed", "Communication with this domain is restricted"));
13 return true;
13 end 14 end
14 end 15 end
15 end 16 end
16 17
17 check_incoming_stanza = stanza_checker("from"); 18 check_incoming_stanza = stanza_checker("from");