aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_pubsub/mod_pubsub.lua
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
commitf13a157f2ebbc7691f1d717eb8d3ebf680549413 (patch)
treea0be1e396c4e09d908f8f48e9476d92625427c03 /plugins/mod_pubsub/mod_pubsub.lua
parent45d221ffec158643440974fc200efe4789eea56c (diff)
downloadprosody-f13a157f2ebbc7691f1d717eb8d3ebf680549413.tar.gz
prosody-f13a157f2ebbc7691f1d717eb8d3ebf680549413.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.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;