comparison mod_firewall/conditions.lib.lua @ 2465:bd69ffe071e6

mod_firewall: Add 'TO SELF' check ('NOT TO?' worked until commit 9159f9166893)
author Matthew Wild <mwild1@gmail.com>
date Thu, 26 Jan 2017 18:36:15 +0000
parents f96bdfd81eba
children d4bc434a60a4
comparison
equal deleted inserted replaced
2464:01babf1caa4a 2465:bd69ffe071e6
69 return ("from == %q"):format(from), { "from" }; 69 return ("from == %q"):format(from), { "from" };
70 end 70 end
71 71
72 function condition_handlers.TO_EXACTLY(to) 72 function condition_handlers.TO_EXACTLY(to)
73 return ("to == %q"):format(to), { "to" }; 73 return ("to == %q"):format(to), { "to" };
74 end
75
76 function condition_handlers.TO_SELF()
77 return ("to == nil");
74 end 78 end
75 79
76 function condition_handlers.TYPE(type) 80 function condition_handlers.TYPE(type)
77 return compile_comparison_list("(type or (name == 'message' and 'normal') or (name == 'presence' and 'available'))", type), { "type", "name" }; 81 return compile_comparison_list("(type or (name == 'message' and 'normal') or (name == 'presence' and 'available'))", type), { "type", "name" };
78 end 82 end