# HG changeset patch # User Kim Alvefur # Date 1545529992 -3600 # Node ID 233305015373179713db92dfb9cbf258a198aee5 # Parent e7ddf70ae4174de3230bfe2e271dc421a13b2e59 mod_pep: Move broadcaster code around to be more like in mod_pubsub This eases comparing and contrasting these two modules. diff -r e7ddf70ae417 -r 233305015373 plugins/mod_pep.lua --- a/plugins/mod_pep.lua Sun Dec 23 02:50:22 2018 +0100 +++ b/plugins/mod_pep.lua Sun Dec 23 02:53:12 2018 +0100 @@ -136,9 +136,6 @@ if kind == "retract" then kind = "items"; -- XEP-0060 signals retraction in an 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 @@ 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