From c3340977343608838203d910bac77d4a59758274 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 11 Dec 2019 18:06:41 +0100 Subject: [PATCH] Fix comments feed --- server/controllers/feeds.ts | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/server/controllers/feeds.ts b/server/controllers/feeds.ts index ba5a476e7..fa6c7ac71 100644 --- a/server/controllers/feeds.ts +++ b/server/controllers/feeds.ts @@ -57,19 +57,22 @@ async function generateVideoCommentsFeed (req: express.Request, res: express.Res const link = WEBSERVER.URL + comment.getCommentStaticPath() let title = comment.Video.name - if (comment.Account) title += ` - ${comment.Account.getDisplayName()}` + const author: { name: string, link: string }[] = [] + + if (comment.Account) { + title += ` - ${comment.Account.getDisplayName()}` + author.push({ + name: comment.Account.getDisplayName(), + link: comment.Account.Actor.url + }) + } feed.addItem({ title, id: comment.url, link, content: comment.text, - author: [ - { - name: comment.Account.getDisplayName(), - link: comment.Account.Actor.url - } - ], + author, date: comment.createdAt }) })