This commit is contained in:
Baris Soner Usakli
2014-03-01 19:15:18 -05:00
parent 42a7c037e6
commit b6d97281d3
3 changed files with 122 additions and 103 deletions

View File

@@ -151,8 +151,20 @@ SocketPosts.edit = function(socket, data, callback) {
return callback(new Error('content-too-short'));
}
postTools.edit(socket.uid, data.pid, data.title, data.content, {topic_thumb: data.topic_thumb});
callback();
postTools.edit(socket.uid, data.pid, data.title, data.content, {topic_thumb: data.topic_thumb}, function(err, results) {
if(err) {
return callback(err);
}
index.server.sockets.in('topic_' + results.topic.tid).emit('event:post_edited', {
pid: data.pid,
title: results.topic.title,
isMainPost: results.topic.isMainPost,
content: results.content
});
callback();
});
};
SocketPosts.delete = function(socket, data, callback) {