diff options
author | Kim Alvefur <zash@zash.se> | 2018-03-21 23:41:03 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2018-03-21 23:41:03 +0100 |
commit | 4ac8e06e0b08abc9469b2756f5c32f2b740bbf74 (patch) | |
tree | a0be1e396c4e09d908f8f48e9476d92625427c03 /plugins/mod_pubsub/mod_pubsub.lua | |
parent | 3096a0770cd5d4d7fe057260e49ecdbc4f738ab1 (diff) | |
download | prosody-4ac8e06e0b08abc9469b2756f5c32f2b740bbf74.tar.gz prosody-4ac8e06e0b08abc9469b2756f5c32f2b740bbf74.zip |
mod_pubsub: Reject publishing of non-items
Diffstat (limited to 'plugins/mod_pubsub/mod_pubsub.lua')
-rw-r--r-- | plugins/mod_pubsub/mod_pubsub.lua | 5 |
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; |