mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-03-05 03:51:26 +01:00
closes #5735
This commit is contained in:
@@ -86,37 +86,35 @@ module.exports = function (SocketTopics) {
|
||||
}
|
||||
|
||||
async.each(data.tids, function (tid, next) {
|
||||
var title;
|
||||
async.waterfall([
|
||||
function (next) {
|
||||
topics.getTopicField(tid, 'title', next);
|
||||
},
|
||||
function (_title, next) {
|
||||
title = _title;
|
||||
topics.tools[action](tid, socket.uid, next);
|
||||
},
|
||||
function (data, next) {
|
||||
socketHelpers.emitToTopicAndCategory(event, data);
|
||||
logTopicAction(action, socket, tid, next);
|
||||
logTopicAction(action, socket, tid, title, next);
|
||||
},
|
||||
], next);
|
||||
}, callback);
|
||||
};
|
||||
|
||||
function logTopicAction(action, socket, tid, callback) {
|
||||
function logTopicAction(action, socket, tid, title, callback) {
|
||||
var actionsToLog = ['delete', 'restore', 'purge'];
|
||||
if (actionsToLog.indexOf(action) === -1) {
|
||||
return setImmediate(callback);
|
||||
}
|
||||
async.waterfall([
|
||||
function (next) {
|
||||
topics.getTopicField(tid, 'title', next);
|
||||
},
|
||||
function (title, next) {
|
||||
events.log({
|
||||
type: 'topic-' + action,
|
||||
uid: socket.uid,
|
||||
ip: socket.ip,
|
||||
tid: tid,
|
||||
title: String(title),
|
||||
}, next);
|
||||
},
|
||||
], callback);
|
||||
events.log({
|
||||
type: 'topic-' + action,
|
||||
uid: socket.uid,
|
||||
ip: socket.ip,
|
||||
tid: tid,
|
||||
title: String(title),
|
||||
}, callback);
|
||||
}
|
||||
|
||||
SocketTopics.orderPinnedTopics = function (socket, data, callback) {
|
||||
|
||||
Reference in New Issue
Block a user