Changeset

901:e3ad5f3aa6d4

mod_admin_web: Adapt to util.pubsub changes
author Florian Zeitz <florob@babelmonkeys.de>
date Sat, 26 Jan 2013 00:15:24 +0100
parents 900:aca1c5eb0508
children 902:490cb9161c81
files mod_admin_web/admin_web/mod_admin_web.lua
diffstat 1 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mod_admin_web/admin_web/mod_admin_web.lua	Fri Jan 18 10:00:59 2013 +0100
+++ b/mod_admin_web/admin_web/mod_admin_web.lua	Sat Jan 26 00:15:24 2013 +0100
@@ -114,12 +114,14 @@
 	});
 
 	-- Setup adminsub service
-	local function simple_broadcast(node, jids, item)
-		item = st.clone(item);
-		item.attr.xmlns = nil; -- Clear the pubsub namespace
+	local function simple_broadcast(kind, node, jids, item)
+		if item then
+			item = st.clone(item);
+			item.attr.xmlns = nil; -- Clear the pubsub namespace
+		end
 		local message = st.message({ from = module.host, type = "headline" })
 			:tag("event", { xmlns = xmlns_adminsub .. "#event" })
-				:tag("items", { node = node })
+				:tag(kind, { node = node })
 					:add_child(item);
 		for jid in pairs(jids) do
 			module:log("debug", "Sending notification to %s", jid);