Software /
code /
prosody
Diff
plugins/mod_pubsub/mod_pubsub.lua @ 8695:09e7fd8b16cd
mod_pubsub: Reject publishing of non-items
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Wed, 21 Mar 2018 23:41:03 +0100 |
parent | 8505:c9bdb4dfed96 |
child | 8808:40a7135eb6ac |
line wrap: on
line diff
--- a/plugins/mod_pubsub/mod_pubsub.lua Wed Mar 21 23:40:45 2018 +0100 +++ b/plugins/mod_pubsub/mod_pubsub.lua Wed Mar 21 23:41:03 2018 +0100 @@ -59,6 +59,10 @@ 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 @@ nodestore = node_store; itemstore = create_simple_itemstore; broadcaster = simple_broadcast; + itemcheck = is_item_stanza; get_affiliation = get_affiliation; normalize_jid = jid_bare;