aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
Diffstat (limited to 'util')
-rw-r--r--util/pubsub.lua11
1 files changed, 10 insertions, 1 deletions
diff --git a/util/pubsub.lua b/util/pubsub.lua
index a53e8b95..e5e0cb7c 100644
--- a/util/pubsub.lua
+++ b/util/pubsub.lua
@@ -436,10 +436,19 @@ function service:create(node, actor, options) --> ok, err
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 = {};
};