From d69847c54ead0869b38f4969acbd1d171d3bb78c Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Sun, 3 Nov 2013 17:49:03 -0500 Subject: [PATCH] NodeBB will now fire hooks if a config setting changes --- src/websockets.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) 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); }); });