Node.js based forum software built for the modern web
added missing filter:post.tools
barisusakliee71f982b7dc
diff --git a/src/socket.io/posts/tools.js b/src/socket.io/posts/tools.jsindex d05c2b74be..5830820cb6 100644--- a/src/socket.io/posts/tools.js+++ b/src/socket.io/posts/tools.js@@ -7,14 +7,14 @@ var events = require('../../events');var websockets = require('../index');var socketTopics = require('../topics');var privileges = require('../../privileges');+var plugins = require('../../plugins');var favourites = require('../../favourites');-module.exports = function(SocketPosts) {SocketPosts.loadPostTools = function(socket, data, callback) {if (!data) {- return callback(new Error('[[error:invalid-data]]'))+ return callback(new Error('[[error:invalid-data]]'));}async.parallel({@@ -26,12 +26,15 @@ module.exports = function(SocketPosts) {},favourited: function(next) {favourites.getFavouritesByPostIDs([data.pid], socket.uid, next);+ },+ tools: function(next) {+ plugins.fireHook('filter:post.tools', {pid: data.pid, uid: socket.uid, tools: []}, next);}}, function(err, results) {if (err) {return callback(err);}- results.posts.tools = []; // TODO: add filter for this+ results.posts.tools = results.tools.tools;results.posts.deleted = parseInt(results.posts.deleted, 10) === 1;results.posts.favourited = results.favourited[0];results.posts.selfPost = socket.uid && socket.uid === parseInt(results.posts.uid, 10);