some more fixes, cant quote and see deleted messages

This commit is contained in:
Baris Soner Usakli
2014-01-25 22:19:51 -05:00
parent 5fde1eb3e7
commit 2988230b07
3 changed files with 34 additions and 36 deletions

View File

@@ -93,7 +93,17 @@ SocketPosts.uploadFile = function(socket, data, callback) {
};
SocketPosts.getRawPost = function(socket, pid, callback) {
posts.getPostField(pid, 'content', callback);
posts.getPostFields(pid, ['content', 'deleted'], function(err, data) {
if(err) {
return callback(err);
}
if(data.deleted === '1') {
return callback(new Error('This post no longer exists'));
}
callback(null, data.content);
});
};
SocketPosts.edit = function(socket, data, callback) {