Skip to content

Node.js based forum software built for the modern web

NodeBB will now fire hooks if a config setting changes

Julian Lamd69847c54ead
diff --git a/src/websockets.js b/src/websockets.js
index ea3bd0dca0..aa650d4173 100644
--- a/src/websockets.js
+++ b/src/websockets.js
@@ -666,10 +666,17 @@ module.exports.init = function(io) {
socket.on('api:config.set', function(data) {
meta.configs.set(data.key, data.value, function(err) {
- if (!err) socket.emit('api:config.set', {
- status: 'ok'
- });
- /* Another hook, for my (adarqui's) logger module */
+ if (!err) {
+ socket.emit('api:config.set', {
+ status: 'ok'
+ });
+
+ plugins.fireHook('action:config.set', {
+ key: data.key,
+ value: data.value
+ });
+ }
+
logger.monitorConfig(this, data);
});
});