util/pubsub.lua
branch0.11
changeset 9844 ec353524b739
parent 9820 7f84d7f77a00
child 10360 0a2d7efca039
child 10522 9f50489c2033
--- a/util/pubsub.lua	Sat Mar 02 22:26:01 2019 +0100
+++ b/util/pubsub.lua	Sun Mar 03 19:31:56 2019 +0100
@@ -436,10 +436,19 @@
 		return false, "conflict";
 	end
 
+	local config = setmetatable(options or {}, {__index=self.node_defaults});
+
+	if self.config.check_node_config then
+		local ok = self.config.check_node_config(node, actor, config);
+		if not ok then
+			return false, "not-acceptable";
+		end
+	end
+
 	self.nodes[node] = {
 		name = node;
 		subscribers = {};
-		config = setmetatable(options or {}, {__index=self.node_defaults});
+		config = config;
 		affiliations = {};
 	};