Skip to content

Commit

Permalink
fix: douban people status: case of parent status deleted but parent_s…
Browse files Browse the repository at this point in the history
…tatus is not null (#6302)
  • Loading branch information
shunf4 authored Dec 1, 2020
1 parent ca6e8b6 commit db0575d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/routes/douban/people/status.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,22 +196,22 @@ function getContentByActivity(ctx, item, params = {}, picsPrefixes = []) {
let usernameAndAvatar = '';

if (readable) {
usernameAndAvatar += `<a href="${status.parent_status.author.url}">`;
usernameAndAvatar += `<a href="${status.parent_status.author === undefined ? 'https://www.douban.com/people/1/' : status.parent_status.author.url}">`;
}
if (authorNameBold) {
usernameAndAvatar += `<strong>`;
}
usernameAndAvatar += status.parent_status.author.name;
usernameAndAvatar += status.parent_status.author === undefined ? '[原转发不可访问]' : status.parent_status.author.name;
if (authorNameBold) {
usernameAndAvatar += `</strong>`;
}
if (readable) {
usernameAndAvatar += `</a>`;
}
usernameAndAvatar += `:&ensp;`;
description += usernameAndAvatar + status.parent_status.text;
description += usernameAndAvatar + (status.parent_status.text === undefined ? '[原转发不可访问]' : status.parent_status.text);
if (showRetweetTextInTitle) {
title += status.parent_status.author.name + ': ' + status.parent_status.text;
title += status.parent_status.text === undefined ? '[原转发不可访问]' : status.parent_status.author.name + ': ' + status.parent_status.text;
}
}

Expand Down Expand Up @@ -268,8 +268,8 @@ function getContentByActivity(ctx, item, params = {}, picsPrefixes = []) {
}

if (status.reshared_status.deleted) {
description += `原动态不可访问`;
title += `原动态不可访问`;
description += `[原动态不可访问]`;
title += `[原动态不可访问]`;
} else {
description += getContentByActivity(
ctx,
Expand Down

1 comment on commit db0575d

@vercel
Copy link

@vercel vercel bot commented on db0575d Dec 1, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.