# HG changeset patch # User Matthew Wild # Date 1533147487 -3600 # Node ID 46d4322f7eedd9c43fd55b432093efed91132e89 # Parent 0462405b1cfb5002a8849eb8bd9ba296e4ba3647 util.pubsub: Add support for a config validation function diff -r 0462405b1cfb -r 46d4322f7eed util/pubsub.lua --- a/util/pubsub.lua Wed Aug 01 19:08:09 2018 +0100 +++ b/util/pubsub.lua Wed Aug 01 19:18:07 2018 +0100 @@ -542,6 +542,13 @@ return false, "item-not-found"; end + if self.config.check_node_config then + local ok = self.config.check_node_config(node, actor, new_config); + if not ok then + return false, "not-acceptable"; + end + end + local old_config = node_obj.config; node_obj.config = setmetatable(new_config, {__index=self.node_defaults});