util/pubsub.lua
changeset 3909 c2dc7f7eed94
parent 3759 1f7305784e12
child 3910 80fe910f912a
--- a/util/pubsub.lua	Tue Dec 21 03:18:17 2010 +0000
+++ b/util/pubsub.lua	Tue Dec 21 03:22:40 2010 +0000
@@ -3,8 +3,19 @@
 local service = {};
 local service_mt = { __index = service };
 
-function new(cb)
-	return setmetatable({ cb = cb or {}, nodes = {} }, service_mt);
+local default_config = {
+	broadcaster = function () end;
+	get_affiliation = function () end;
+	capabilities = {};
+};
+
+function new(config)
+	config = config or {};
+	return setmetatable({
+		config = setmetatable(config, { __index = default_config });
+		affiliations = {};
+		nodes = {};
+	}, service_mt);
 end
 
 function service:add_subscription(node, actor, jid)