aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2018-12-23 02:53:12 +0100
committerKim Alvefur <zash@zash.se>2018-12-23 02:53:12 +0100
commit4cbf600434638bcb53c8defb767a076135ab8f24 (patch)
tree17477513f7619558d94728ee1cf73e99070231b0
parented48077ce4b5ac8310270edb93c7d68a88cf0602 (diff)
downloadprosody-4cbf600434638bcb53c8defb767a076135ab8f24.tar.gz
prosody-4cbf600434638bcb53c8defb767a076135ab8f24.zip
mod_pep: Move broadcaster code around to be more like in mod_pubsub
This eases comparing and contrasting these two modules.
-rw-r--r--plugins/mod_pep.lua9
1 files changed, 6 insertions, 3 deletions
diff --git a/plugins/mod_pep.lua b/plugins/mod_pep.lua
index cb775fb5..40385616 100644
--- a/plugins/mod_pep.lua
+++ b/plugins/mod_pep.lua
@@ -136,9 +136,6 @@ local function get_broadcaster(username)
if kind == "retract" then
kind = "items"; -- XEP-0060 signals retraction in an <items> container
end
- local message = st.message({ from = user_bare, type = "headline" })
- :tag("event", { xmlns = xmlns_pubsub_event })
- :tag(kind, { node = node });
if item then
item = st.clone(item);
item.attr.xmlns = nil; -- Clear the pubsub namespace
@@ -147,6 +144,12 @@ local function get_broadcaster(username)
item:maptags(function () return nil; end);
end
end
+ end
+
+ local message = st.message({ from = user_bare, type = "headline" })
+ :tag("event", { xmlns = xmlns_pubsub_event })
+ :tag(kind, { node = node });
+ if item then
message:add_child(item);
end
for jid in pairs(jids) do