diff mod_firewall/mod_firewall.lua @ 2412:9159f9166893

mod_firewall: Use the sender bare JID instead of 'to' for stanzas to self
author Kim Alvefur <zash@zash.se>
date Sat, 03 Dec 2016 20:00:08 +0100
parents 9af2d36567a8
children 07d7036040ee
line wrap: on
line diff
--- a/mod_firewall/mod_firewall.lua	Sat Dec 03 15:28:22 2016 +0100
+++ b/mod_firewall/mod_firewall.lua	Sat Dec 03 20:00:08 2016 +0100
@@ -90,7 +90,7 @@
 	jid_bare = {
 		global_code = [[local jid_bare = require "util.jid".bare;]];
 	};
-	to = { local_code = [[local to = stanza.attr.to;]] };
+	to = { local_code = [[local to = stanza.attr.to or jid_bare(session.full_jid);]]; depends = { "jid_bare" } };
 	from = { local_code = [[local from = stanza.attr.from;]] };
 	type = { local_code = [[local type = stanza.attr.type;]] };
 	name = { local_code = [[local name = stanza.name]] };