diff --git a/lib/v2/jike/user.js b/lib/v2/jike/user.js index 9f226f3ff2..30a8cdc371 100644 --- a/lib/v2/jike/user.js +++ b/lib/v2/jike/user.js @@ -109,10 +109,13 @@ module.exports = async (ctx) => { pubDate: parseDate(item.createdAt), link: getLink(item.id, item.type), _extra: repostContent && { - quote: { - url: getLink(item.target.id, item.target.type), - content_html: repostContent, - }, + links: [ + { + url: getLink(item.target.id, item.target.type), + content_html: repostContent, + type: 'quote', + }, + ], }, }; diff --git a/lib/v2/twitter/utils.js b/lib/v2/twitter/utils.js index 15a2c9737a..c369e4bfba 100644 --- a/lib/v2/twitter/utils.js +++ b/lib/v2/twitter/utils.js @@ -385,12 +385,32 @@ const ProcessFeed = (ctx, { data = [] }, params = {}) => { pubDate: parseDate(item.created_at), link: `https://twitter.com/${item.user.screen_name}/status/${item.id_str}`, - _extra: item.is_quote_status && { - quote: { - url: `https://twitter.com/${item.quoted_status.user?.screen_name}/status/${item.quoted_status.id_str}`, - content_html: quote, - }, - }, + _extra: + (isRetweet && { + links: [ + { + type: 'repost', + }, + ], + }) || + (item.is_quote_status && { + links: [ + { + url: `https://twitter.com/${item.quoted_status.user?.screen_name}/status/${item.quoted_status.id_str}`, + content_html: quote, + type: 'quote', + }, + ], + }) || + (item.in_reply_to_screen_name && + item.in_reply_to_status_id_str && { + links: [ + { + url: `https://twitter.com/${item.in_reply_to_screen_name}/status/${item.in_reply_to_status_id_str}`, + type: 'reply', + }, + ], + }), }; }); };