diff 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
line wrap: on
line diff
--- a/mod_firewall/conditions.lib.lua	Thu Jun 08 11:25:40 2023 +0100
+++ b/mod_firewall/conditions.lib.lua	Thu Jun 08 11:28:06 2023 +0100
@@ -67,6 +67,10 @@
 	return compile_jid_match("from", from), { "split_from" };
 end
 
+function condition_handlers.FROM_FULL_JID()
+	return compile_jid_match_part("from_resource", nil), { "split_from" };
+end
+
 function condition_handlers.FROM_EXACTLY(from)
 	local metadeps = {};
 	return ("from == %s"):format(metaq(from, metadeps)), { "from", unpack(metadeps) };