adding uid to the topic hooks, so plugins can know the user that did the action

v1.18.x
psychobunny 11 years ago
parent fd78085c59
commit 788b16fa62

@ -269,7 +269,7 @@ SocketTopics.move = function(socket, data, callback) {
}, },
function(cid, next) { function(cid, next) {
oldCid = cid; oldCid = cid;
threadTools.move(tid, data.cid, next); threadTools.move(tid, data.cid, data.uid, next);
} }
], function(err) { ], function(err) {
if(err) { if(err) {
@ -305,7 +305,7 @@ SocketTopics.moveAll = function(socket, data, callback) {
} }
async.each(tids, function(tid, next) { async.each(tids, function(tid, next) {
threadTools.move(tid, data.cid, next); threadTools.move(tid, data.cid, data.uid, next);
}, callback); }, callback);
}); });
}); });

@ -119,7 +119,8 @@ var winston = require('winston'),
plugins.fireHook('action:topic.lock', { plugins.fireHook('action:topic.lock', {
tid: tid, tid: tid,
isLocked: lock isLocked: lock,
uid: uid
}); });
emitTo('topic_' + tid); emitTo('topic_' + tid);
@ -162,7 +163,8 @@ var winston = require('winston'),
plugins.fireHook('action:topic.pin', { plugins.fireHook('action:topic.pin', {
tid: tid, tid: tid,
isPinned: pin isPinned: pin,
uid: uid
}); });
emitTo('topic_' + tid); 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; var topic;
async.waterfall([ async.waterfall([
function(next) { function(next) {
@ -209,7 +211,8 @@ var winston = require('winston'),
plugins.fireHook('action:topic.move', { plugins.fireHook('action:topic.move', {
tid: tid, tid: tid,
fromCid: oldCid, fromCid: oldCid,
toCid: cid toCid: cid,
uid: uid
}); });
}); });
}; };

Loading…
Cancel
Save