aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2018-03-21 23:41:03 +0100
committerKim Alvefur <zash@zash.se>2018-03-21 23:41:03 +0100
commit4ac8e06e0b08abc9469b2756f5c32f2b740bbf74 (patch)
treea0be1e396c4e09d908f8f48e9476d92625427c03 /plugins
parent3096a0770cd5d4d7fe057260e49ecdbc4f738ab1 (diff)
downloadprosody-4ac8e06e0b08abc9469b2756f5c32f2b740bbf74.tar.gz
prosody-4ac8e06e0b08abc9469b2756f5c32f2b740bbf74.zip
mod_pubsub: Reject publishing of non-items
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_pubsub/mod_pubsub.lua5
1 files changed, 5 insertions, 0 deletions
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;