chop chop

This commit is contained in:
barisusakli
2014-11-19 23:37:55 -05:00
parent 6012223b81
commit d177481f94
8 changed files with 14 additions and 95 deletions

View File

@@ -63,8 +63,6 @@ SocketPosts.reply = function(socket, data, callback) {
}
});
});
websockets.emitTopicPostStats();
});
};
@@ -223,17 +221,15 @@ SocketPosts.restore = function(socket, data, callback) {
};
function deleteOrRestore(command, socket, data, callback) {
if(!data) {
if (!data) {
return callback(new Error('[[error:invalid-data]]'));
}
postTools[command](socket.uid, data.pid, function(err, postData) {
if(err) {
if (err) {
return callback(err);
}
websockets.emitTopicPostStats();
var eventName = command === 'restore' ? 'event:post_restored' : 'event:post_deleted';
websockets.server.sockets.in('topic_' + data.tid).emit(eventName, postData);
@@ -250,8 +246,6 @@ SocketPosts.purge = function(socket, data, callback) {
return callback(err);
}
websockets.emitTopicPostStats();
websockets.server.sockets.in('topic_' + data.tid).emit('event:post_purged', data.pid);
callback();