added toPid to posts

This commit is contained in:
Baris Soner Usakli
2014-02-22 17:56:13 -05:00
parent 81555671da
commit d6d9776cde
5 changed files with 34 additions and 16 deletions

View File

@@ -14,6 +14,7 @@ var async = require('async'),
SocketPosts = {};
SocketPosts.reply = function(socket, data, callback) {
if (!socket.uid && !parseInt(meta.config.allowGuestPosting, 10)) {
socket.emit('event:alert', {
title: 'Reply Unsuccessful',
@@ -28,7 +29,9 @@ SocketPosts.reply = function(socket, data, callback) {
return callback(new Error('invalid data'));
}
topics.reply(data.topic_id, socket.uid, data.content, function(err, postData) {
data.uid = socket.uid;
topics.reply(data, function(err, postData) {
if(err) {
if (err.message === 'content-too-short') {
module.parent.exports.emitContentTooShortAlert(socket);