From 4ac8e06e0b08abc9469b2756f5c32f2b740bbf74 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Wed, 21 Mar 2018 23:41:03 +0100 Subject: mod_pubsub: Reject publishing of non-items --- plugins/mod_pubsub/mod_pubsub.lua | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'plugins/mod_pubsub/mod_pubsub.lua') diff --git a/plugins/mod_pubsub/mod_pubsub.lua b/plugins/mod_pubsub/mod_pubsub.lua index 2b07740a..d3d5f59f 100644 --- a/plugins/mod_pubsub/mod_pubsub.lua +++ b/plugins/mod_pubsub/mod_pubsub.lua @@ -59,6 +59,10 @@ function simple_broadcast(kind, node, jids, item, actor) end end +function is_item_stanza(item) + return st.is_stanza(item) and item.attr.xmlns == xmlns_pubsub and item.name == "item"; +end + module:hook("iq/host/"..xmlns_pubsub..":pubsub", handle_pubsub_iq); module:hook("iq/host/"..xmlns_pubsub_owner..":pubsub", handle_pubsub_iq); @@ -207,6 +211,7 @@ function module.load() nodestore = node_store; itemstore = create_simple_itemstore; broadcaster = simple_broadcast; + itemcheck = is_item_stanza; get_affiliation = get_affiliation; normalize_jid = jid_bare; -- cgit v1.2.3