Node.js based forum software built for the modern web
https://github.com/akhoury/nodebb-plugin-spam-be-gone/issues/46
barisusaklic9ac1a402796
diff --git a/src/posts/edit.js b/src/posts/edit.jsindex ea7686fb20..0d4a78a019 100644--- a/src/posts/edit.js+++ b/src/posts/edit.js@@ -41,7 +41,7 @@ module.exports = function(Posts) {postData.content = data.content;postData.edited = now;postData.editor = data.uid;- plugins.fireHook('filter:post.edit', {post: postData, uid: data.uid}, next);+ plugins.fireHook('filter:post.edit', {req: data.req, post: postData, uid: data.uid}, next);},function (result, next) {postData = result.post;@@ -128,9 +128,9 @@ module.exports = function(Posts) {data.tags = data.tags || [];async.waterfall([- async.apply(plugins.fireHook,'filter:topic.edit', topicData),- function(topicData, next) {- db.setObject('topic:' + tid, topicData, next);+ async.apply(plugins.fireHook, 'filter:topic.edit', {req: data.req, topic: topicData}),+ function(results, next) {+ db.setObject('topic:' + tid, results.topicData, next);},function(next) {topics.updateTags(tid, data.tags, next);diff --git a/src/socket.io/index.js b/src/socket.io/index.jsindex 73c98f34ea..109821f461 100644--- a/src/socket.io/index.js+++ b/src/socket.io/index.js@@ -186,6 +186,7 @@ function authorize(socket, callback) {return next(err);}if (sessionData && sessionData.passport && sessionData.passport.user) {+ request.session = sessionData;socket.uid = parseInt(sessionData.passport.user, 10);} else {socket.uid = 0;diff --git a/src/socket.io/posts/edit.js b/src/socket.io/posts/edit.jsindex bec03451fb..e5ad7a0afb 100644--- a/src/socket.io/posts/edit.js+++ b/src/socket.io/posts/edit.js@@ -37,7 +37,8 @@ module.exports = function(SocketPosts) {title: data.title,content: data.content,topic_thumb: data.topic_thumb,- tags: data.tags+ tags: data.tags,+ req: websockets.reqFromSocket(socket)}, function(err, result) {if (err) {return callback(err);