From b84889d4ebd8e09091f8296699350a507a6080b4 Mon Sep 17 00:00:00 2001 From: cel Date: Sun, 28 Oct 2018 14:30:50 -1000 Subject: Prefer feed's own About info if are following it --- lib/about.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/about.js b/lib/about.js index 4605c4b..5f1c618 100644 --- a/lib/about.js +++ b/lib/about.js @@ -117,15 +117,20 @@ About.prototype.get = function (dest, cb) { if (c.publicWebHosting) about.publicWebHosting = c.publicWebHosting }, function (err) { if (err) return cb(err) + var destAbout = aboutByFeedFollowed[dest] || aboutByFeed[dest] // bias the author's choices by giving them an extra vote - if (follows[dest]) aboutByFeedFollowed._author = aboutByFeedFollowed[dest] - else aboutByFeed._author = aboutByFeed[dest] + if (destAbout) { + if (follows[dest]) aboutByFeedFollowed._author = destAbout + else aboutByFeed._author = destAbout + } var about = {} var followedAbout = computeTopAbout(aboutByFeedFollowed) var topAbout = computeTopAbout(aboutByFeed) for (var k in topAbout) about[k] = topAbout[k] // prefer followed feeds' choices for (var k in followedAbout) about[k] = followedAbout[k] + // if we follow the destination/author feed, prefer its choices + if (follows[dest]) for (var k in destAbout) about[k] = destAbout[k] // always prefer own choices for (var k in myAbout) about[k] = myAbout[k] cb(null, about) -- cgit v1.2.3