FIX: Allow displaying posts by deleted users.

This commit is contained in:
Konrad Borowski 2016-03-21 08:49:49 +01:00
parent 67a5fc39de
commit dd2605bae7
1 changed files with 6 additions and 4 deletions

View File

@ -85,9 +85,11 @@ export default function transformPost(currentUser, site, post, prevPost, nextPos
const postAtts = transformBasicPost(post); const postAtts = transformBasicPost(post);
const createdBy = details.created_by || {};
postAtts.topicId = topic.id; postAtts.topicId = topic.id;
postAtts.topicOwner = details.created_by.id === post.user_id; postAtts.topicOwner = createdBy.id === post.user_id;
postAtts.topicCreatedById = details.created_by.id; postAtts.topicCreatedById = createdBy.id;
postAtts.post_type = postType; postAtts.post_type = postType;
postAtts.via_email = post.via_email; postAtts.via_email = post.via_email;
postAtts.isModeratorAction = postType === postTypes.moderator_action; postAtts.isModeratorAction = postType === postTypes.moderator_action;
@ -120,8 +122,8 @@ export default function transformPost(currentUser, site, post, prevPost, nextPos
if (showTopicMap) { if (showTopicMap) {
postAtts.showTopicMap = true; postAtts.showTopicMap = true;
postAtts.topicCreatedAt = topic.created_at; postAtts.topicCreatedAt = topic.created_at;
postAtts.createdByUsername = details.created_by.username; postAtts.createdByUsername = createdBy.username;
postAtts.createdByAvatarTemplate = details.created_by.avatar_template; postAtts.createdByAvatarTemplate = createdBy.avatar_template;
postAtts.lastPostUrl = topic.get('lastPostUrl'); postAtts.lastPostUrl = topic.get('lastPostUrl');
postAtts.lastPostUsername = details.last_poster.username; postAtts.lastPostUsername = details.last_poster.username;