if every post gets deleted in a topic, then the topic deletes itself also

This commit is contained in:
Julian Lam
2013-07-15 15:25:31 -04:00
parent 87aec422e9
commit 561ff38e5a
3 changed files with 25 additions and 14 deletions

View File

@@ -286,7 +286,14 @@ var SocketIO = require('socket.io').listen(global.server, { log:false }),
});
socket.on('api:topic.delete', function(data) {
threadTools.delete(data.tid, uid, socket);
threadTools.delete(data.tid, uid, function(err) {
if (!err) {
socket.emit('api:topic.delete', {
status: 'ok',
tid: data.tid
});
}
});
});
socket.on('api:topic.restore', function(data) {