Diff

util/pubsub.lua @ 9845:774b2ce62318

Merge 0.11->trunk
author Kim Alvefur <zash@zash.se>
date Mon, 04 Mar 2019 13:46:09 +0100
parent 9840:ec353524b739
child 10356:0a2d7efca039
child 10518:9f50489c2033
line wrap: on
line diff
--- a/util/pubsub.lua	Mon Mar 04 13:13:37 2019 +0100
+++ b/util/pubsub.lua	Mon Mar 04 13:46:09 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 = {};
 	};