aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2018-10-28 14:30:50 -1000
committercel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2018-10-28 14:51:15 -1000
commitb84889d4ebd8e09091f8296699350a507a6080b4 (patch)
tree490a9aa1139e26ce7c63b9b63a1e3ca6f5b13d95
parent80435e39321a8a5aef016c2d73f0580ab05d6708 (diff)
downloadpatchfoo-b84889d4ebd8e09091f8296699350a507a6080b4.tar.gz
patchfoo-b84889d4ebd8e09091f8296699350a507a6080b4.zip
Prefer feed's own About info if are following it
-rw-r--r--lib/about.js9
1 files 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)