closes #2550, closes #2518

This commit is contained in:
barisusakli
2015-02-01 19:11:58 -05:00
parent 79083004e4
commit 2c8e8a1f1c
17 changed files with 369 additions and 249 deletions

View File

@@ -15,6 +15,7 @@ var nconf = require('nconf'),
user = require('../user'),
db = require('../database'),
meta = require('../meta'),
events = require('../events'),
utils = require('../../public/src/utils'),
SocketPosts = require('./posts'),
@@ -259,7 +260,21 @@ function doTopicAction(action, socket, data, callback) {
}
if(typeof threadTools[action] === 'function') {
threadTools[action](tid, socket.uid, next);
threadTools[action](tid, socket.uid, function(err) {
if (err) {
return next(err);
}
if (action === 'delete' || action === 'restore' || action === 'purge') {
events.log({
type: 'topic-' + action,
uid: socket.uid,
ip: socket.ip,
tid: tid
});
}
next();
});
}
});
}, callback);