diff options
author | Matthew Wild <mwild1@gmail.com> | 2018-08-01 19:18:07 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2018-08-01 19:18:07 +0100 |
commit | 3072e924380b83fa03c022d7d33b1a98042f7344 (patch) | |
tree | debbedc3271b1f877f1531a3bb5ae4067f4d880a /util | |
parent | ac5f82e4b6d1adb47c1abf9b5f96146ffe9f9324 (diff) | |
download | prosody-3072e924380b83fa03c022d7d33b1a98042f7344.tar.gz prosody-3072e924380b83fa03c022d7d33b1a98042f7344.zip |
util.pubsub: Add support for a config validation function
Diffstat (limited to 'util')
-rw-r--r-- | util/pubsub.lua | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/util/pubsub.lua b/util/pubsub.lua index b7f89844..3ab488d3 100644 --- a/util/pubsub.lua +++ b/util/pubsub.lua @@ -542,6 +542,13 @@ function service:set_node_config(node, actor, new_config) 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}); |