comparison mod_firewall/conditions.lib.lua @ 964:04e85eb3dfef

mod_firewall/conditions: Default types for message and presence
author Matthew Wild <mwild1@gmail.com>
date Fri, 05 Apr 2013 19:20:05 +0100
parents c7fca2c9e24f
children d4e24fb289c0
comparison
equal deleted inserted replaced
963:c7fca2c9e24f 964:04e85eb3dfef
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 59 end
60 60
61 function condition_handlers.TYPE(type) 61 function condition_handlers.TYPE(type)
62 return compile_comparison_list("type", type), { "type" }; 62 return compile_comparison_list("(type or (name == 'message' and 'chat') or (name == 'presence' and 'available'))", type), { "type", "name" };
63 end
63 end 64 end
64 65
65 function condition_handlers.ENTERING(zone) 66 function condition_handlers.ENTERING(zone)
66 return ("(zones[%q] and (zones[%q][to_host] or " 67 return ("(zones[%q] and (zones[%q][to_host] or "
67 .."zones[%q][to] or " 68 .."zones[%q][to] or "