comparison mod_firewall/conditions.lib.lua @ 2036:7ba6ed553c93

mod_firewall/conditions: Add FROM_EXACTLY and TO_EXACTLY
author Matthew Wild <mwild1@gmail.com>
date Mon, 01 Feb 2016 20:24:51 +0000
parents 69dd4e4e54a2
children 2356114ff505
comparison
equal deleted inserted replaced
2035:39774b078dde 2036:7ba6ed553c93
54 return compile_jid_match("to", to), { "split_to" }; 54 return compile_jid_match("to", to), { "split_to" };
55 end 55 end
56 56
57 function condition_handlers.FROM(from) 57 function condition_handlers.FROM(from)
58 return compile_jid_match("from", from), { "split_from" }; 58 return compile_jid_match("from", from), { "split_from" };
59 end
60
61 function condition_handlers.FROM_EXACTLY(from)
62 return ("from == %q"):format(from), { "from" };
63 end
64
65 function condition_handlers.TO_EXACTLY(to)
66 return ("to == %q"):format(to), { "to" };
59 end 67 end
60 68
61 function condition_handlers.TYPE(type) 69 function condition_handlers.TYPE(type)
62 return compile_comparison_list("(type or (name == 'message' and 'normal') or (name == 'presence' and 'available'))", type), { "type", "name" }; 70 return compile_comparison_list("(type or (name == 'message' and 'normal') or (name == 'presence' and 'available'))", type), { "type", "name" };
63 end 71 end