Software /
code /
prosody-modules
Comparison
mod_firewall/conditions.lib.lua @ 979:cec42f884475
mod_firewall: The default value of the 'type' attribute on message stanzas is 'normal'
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Mon, 08 Apr 2013 17:03:34 +0200 |
parent | 971:53e158e44a44 |
child | 997:69dd4e4e54a2 |
comparison
equal
deleted
inserted
replaced
978:c8f4502c764f | 979:cec42f884475 |
---|---|
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 or (name == 'message' and 'chat') or (name == 'presence' and 'available'))", type), { "type", "name" }; | 62 return compile_comparison_list("(type or (name == 'message' and 'normal') or (name == 'presence' and 'available'))", type), { "type", "name" }; |
63 end | 63 end |
64 | 64 |
65 local function zone_check(zone, which) | 65 local function zone_check(zone, which) |
66 local which_not = which == "from" and "to" or "from"; | 66 local which_not = which == "from" and "to" or "from"; |
67 return ("(zone_%s[%s_host] or zone_%s[%s] or zone_%s[bare_%s]) " | 67 return ("(zone_%s[%s_host] or zone_%s[%s] or zone_%s[bare_%s]) " |