aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_pubsub
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2018-08-16 14:32:21 +0200
committerKim Alvefur <zash@zash.se>2018-08-16 14:32:21 +0200
commitd4dd6144b08a3304ab95dc8df64434dcb31a13e9 (patch)
treeae0edbc4facdcd6150d87ce35800e68ded54b145 /plugins/mod_pubsub
parent3081a87880dfc7299f9e18de69403e2dff9e83cb (diff)
downloadprosody-d4dd6144b08a3304ab95dc8df64434dcb31a13e9.tar.gz
prosody-d4dd6144b08a3304ab95dc8df64434dcb31a13e9.zip
util.pubsub: Pass "retract" as the type of such broadcasts
This moves some XEP-0060 awkwardness out of util.pubsub and into mod_pubsub A retraction is broadcast in an <items> container, whereas most other kinds of broadcasts are in a container with a name matching the 'kind' attribute.
Diffstat (limited to 'plugins/mod_pubsub')
-rw-r--r--plugins/mod_pubsub/mod_pubsub.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/plugins/mod_pubsub/mod_pubsub.lua b/plugins/mod_pubsub/mod_pubsub.lua
index cea4e6b2..d18d5f9f 100644
--- a/plugins/mod_pubsub/mod_pubsub.lua
+++ b/plugins/mod_pubsub/mod_pubsub.lua
@@ -47,6 +47,10 @@ local function create_simple_itemstore(node_config, node_name)
end
function simple_broadcast(kind, node, jids, item, actor, node_obj)
+ if kind == "retract" then
+ kind = "items"; -- XEP-0060 signals retraction in an <items> container
+ end
+
if item then
item = st.clone(item);
item.attr.xmlns = nil; -- Clear the pubsub namespace