aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2018-06-08 23:03:34 +0200
committerEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2018-06-08 23:03:34 +0200
commitf6c0bff75f3ba21bdf72b9ff8b2577ed02a98a88 (patch)
treee37502a5e4bed75dafb50614dfc9b7004404b47c
parent6d79aef1061c6f886fb1cdaa3065f4f559fd9191 (diff)
downloadprosody-f6c0bff75f3ba21bdf72b9ff8b2577ed02a98a88.tar.gz
prosody-f6c0bff75f3ba21bdf72b9ff8b2577ed02a98a88.zip
mod_pep_plus: Prevent nil from being added as a child on item deletion.
-rw-r--r--plugins/mod_pep_plus.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/plugins/mod_pep_plus.lua b/plugins/mod_pep_plus.lua
index fdc8cdbf..92a41719 100644
--- a/plugins/mod_pep_plus.lua
+++ b/plugins/mod_pep_plus.lua
@@ -63,14 +63,14 @@ end
local function get_broadcaster(username)
local user_bare = jid_join(username, host);
local function simple_broadcast(kind, node, jids, item)
+ 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
+ message:add_child(item);
end
- local message = st.message({ from = user_bare, type = "headline" })
- :tag("event", { xmlns = xmlns_pubsub_event })
- :tag(kind, { node = node })
- :add_child(item);
for jid in pairs(jids) do
module:log("debug", "Sending notification to %s from %s: %s", jid, user_bare, tostring(item));
message.attr.to = jid;