Mercurial > prosody-modules
comparison mod_firewall/conditions.lib.lua @ 5530:8226ac08484e
mod_firewall: Add 'FROM FULL JID?' condition
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Thu, 08 Jun 2023 11:28:06 +0100 |
parents | 84997bc3f92e |
children | 7b4e0c3642bf |
comparison
equal
deleted
inserted
replaced
5529:a8f49bf7f8e6 | 5530:8226ac08484e |
---|---|
63 return compile_jid_match("to", to), { "split_to" }; | 63 return compile_jid_match("to", to), { "split_to" }; |
64 end | 64 end |
65 | 65 |
66 function condition_handlers.FROM(from) | 66 function condition_handlers.FROM(from) |
67 return compile_jid_match("from", from), { "split_from" }; | 67 return compile_jid_match("from", from), { "split_from" }; |
68 end | |
69 | |
70 function condition_handlers.FROM_FULL_JID() | |
71 return compile_jid_match_part("from_resource", nil), { "split_from" }; | |
68 end | 72 end |
69 | 73 |
70 function condition_handlers.FROM_EXACTLY(from) | 74 function condition_handlers.FROM_EXACTLY(from) |
71 local metadeps = {}; | 75 local metadeps = {}; |
72 return ("from == %s"):format(metaq(from, metadeps)), { "from", unpack(metadeps) }; | 76 return ("from == %s"):format(metaq(from, metadeps)), { "from", unpack(metadeps) }; |