mod_firewall: Use the sender bare JID instead of 'to' for stanzas to self
authorKim Alvefur <zash@zash.se>
Sat, 03 Dec 2016 20:00:08 +0100
changeset 2416 9159f9166893
parent 2415 e327b06b9a1b
child 2417 b64c0150d663
mod_firewall: Use the sender bare JID instead of 'to' for stanzas to self
mod_firewall/mod_firewall.lua
--- 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]] };