equal
deleted
inserted
replaced
|
1 local st = require "util.stanza"; |
|
2 |
|
3 local blacklist = module:get_option_inherited_set("s2s_blacklist", {}); |
|
4 |
|
5 module:hook("route/remote", function (event) |
|
6 if blacklist:contains(event.to_host) then |
|
7 module:send(st.error_reply(event.stanza, "cancel", "not-allowed", "Communication with this domain is restricted")); |
|
8 return true; |
|
9 end |
|
10 end, 100); |
|
11 |
|
12 module:hook("s2s-stream-features", function (event) |
|
13 if blacklist:contains(event.origin.from_host) then |
|
14 event.origin:close({ |
|
15 condition = "policy-violation"; |
|
16 text = "Communication with this domain is restricted"; |
|
17 }); |
|
18 end |
|
19 end, 1000); |