better handling of guest handles in frontend, #2569

This commit is contained in:
Julian Lam
2014-12-31 21:27:41 -05:00
parent 9befa6aca7
commit 23b9b21cdd
5 changed files with 13 additions and 2 deletions

View File

@@ -35,7 +35,7 @@ SocketModules.composer.push = function(socket, pid, callback) {
if (err || !canRead) {
return callback(err || new Error('[[error:no-privileges]]'));
}
posts.getPostFields(pid, ['content', 'tid', 'uid'], function(err, postData) {
posts.getPostFields(pid, ['content', 'tid', 'uid', 'handle'], function(err, postData) {
if(err || (!postData && !postData.content)) {
return callback(err || new Error('[[error:invalid-pid]]'));
}
@@ -62,6 +62,7 @@ SocketModules.composer.push = function(socket, pid, callback) {
callback(null, {
pid: pid,
uid: postData.uid,
handle: parseInt(meta.config.allowGuestHandles, 10) ? postData.handle : undefined,
body: postData.content,
title: results.topic.title,
topic_thumb: results.topic.thumb,