Diff

mod_admin_web/admin_web/mod_admin_web.lua @ 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
parent 885:292ea8df7267
child 1117:d643c385d3f6
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);