mod_firewall/conditions.lib.lua
changeset 2040 7ba6ed553c93
parent 997 69dd4e4e54a2
child 2074 2356114ff505
equal deleted inserted replaced
2039:39774b078dde 2040: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