Changeset

8696:164da3186511

mod_pep_plus: Validate items here too (thanks Link Mauve)
author Kim Alvefur <zash@zash.se>
date Sun, 25 Mar 2018 23:30:14 +0200
parents 8695:09e7fd8b16cd
children 8697:c60fdf148118
files plugins/mod_pep_plus.lua
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_pep_plus.lua	Wed Mar 21 23:41:03 2018 +0100
+++ b/plugins/mod_pep_plus.lua	Sun Mar 25 23:30:14 2018 +0200
@@ -34,6 +34,10 @@
 	services = data.services;
 end
 
+function is_item_stanza(item)
+	return st.is_stanza(item) and item.attr.xmlns == xmlns_pubsub and item.name == "item";
+end
+
 local function subscription_presence(username, recipient)
 	local user_bare = jid_join(username, host);
 	local recipient_bare = jid_bare(recipient);
@@ -188,6 +192,7 @@
 
 		itemstore = simple_itemstore(username);
 		broadcaster = get_broadcaster(username);
+		itemcheck = is_item_stanza;
 		get_affiliation = function (jid)
 			if jid_bare(jid) == user_bare then
 				return "owner";