Comparison

mod_admin_blocklist/mod_admin_blocklist.lua @ 2313:5d05139d0555

mod_admin_blocklist: Do block check only when a stanza is about to trigger a new outgoing s2s connection
author Kim Alvefur <zash@zash.se>
date Sat, 01 Oct 2016 00:59:15 +0200
parent 1735:c2d43b568178
child 4805:683d1ad16b56
comparison
equal deleted inserted replaced
2312:234d679076c4 2313:5d05139d0555
36 origin.send(st.error_reply(stanza, "cancel", "not-allowed", "Communication with this domain is not allowed")); 36 origin.send(st.error_reply(stanza, "cancel", "not-allowed", "Communication with this domain is not allowed"));
37 return true; 37 return true;
38 end 38 end
39 return false; 39 return false;
40 end 40 end
41 end, 1000); 41 end, -9);
42 42
43 43
44 module:hook("s2s-stream-features", function (event) 44 module:hook("s2s-stream-features", function (event)
45 local session = event.origin; 45 local session = event.origin;
46 if is_blocked(session.from_host) then 46 if is_blocked(session.from_host) then