From 788b16fa62198c26e73342807f593ce1cc2a770b Mon Sep 17 00:00:00 2001 From: psychobunny Date: Thu, 24 Jul 2014 14:32:17 -0400 Subject: [PATCH] adding uid to the topic hooks, so plugins can know the user that did the action --- src/socket.io/topics.js | 4 ++-- src/threadTools.js | 11 +++++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/socket.io/topics.js b/src/socket.io/topics.js index 6dd0ef3168..8f8dbe6df4 100644 --- a/src/socket.io/topics.js +++ b/src/socket.io/topics.js @@ -269,7 +269,7 @@ SocketTopics.move = function(socket, data, callback) { }, function(cid, next) { oldCid = cid; - threadTools.move(tid, data.cid, next); + threadTools.move(tid, data.cid, data.uid, next); } ], function(err) { if(err) { @@ -305,7 +305,7 @@ SocketTopics.moveAll = function(socket, data, callback) { } async.each(tids, function(tid, next) { - threadTools.move(tid, data.cid, next); + threadTools.move(tid, data.cid, data.uid, next); }, callback); }); }); diff --git a/src/threadTools.js b/src/threadTools.js index 2a4279d3dd..f872cb36be 100644 --- a/src/threadTools.js +++ b/src/threadTools.js @@ -119,7 +119,8 @@ var winston = require('winston'), plugins.fireHook('action:topic.lock', { tid: tid, - isLocked: lock + isLocked: lock, + uid: uid }); emitTo('topic_' + tid); @@ -162,7 +163,8 @@ var winston = require('winston'), plugins.fireHook('action:topic.pin', { tid: tid, - isPinned: pin + isPinned: pin, + uid: uid }); emitTo('topic_' + tid); @@ -177,7 +179,7 @@ var winston = require('winston'), }); } - ThreadTools.move = function(tid, cid, callback) { + ThreadTools.move = function(tid, cid, uid, callback) { var topic; async.waterfall([ function(next) { @@ -209,7 +211,8 @@ var winston = require('winston'), plugins.fireHook('action:topic.move', { tid: tid, fromCid: oldCid, - toCid: cid + toCid: cid, + uid: uid }); }); };