diff options
author | Kim Alvefur <zash@zash.se> | 2018-12-23 02:53:12 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2018-12-23 02:53:12 +0100 |
commit | 41426ee8d8bb478eb08840412359e4f1e1464832 (patch) | |
tree | 17477513f7619558d94728ee1cf73e99070231b0 /plugins/mod_pep.lua | |
parent | 5b8df5ea61bf95400c856a65a9e7e24c45bbc17b (diff) | |
download | prosody-41426ee8d8bb478eb08840412359e4f1e1464832.tar.gz prosody-41426ee8d8bb478eb08840412359e4f1e1464832.zip |
mod_pep: Move broadcaster code around to be more like in mod_pubsub
This eases comparing and contrasting these two modules.
Diffstat (limited to 'plugins/mod_pep.lua')
-rw-r--r-- | plugins/mod_pep.lua | 9 |
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 |