Handle boolean value false for publicWebHosting
This commit is contained in:
+5
-1
@@ -9,6 +9,10 @@ function linkDest(val) {
|
||||
return val ? asString(val) || asString(val.link) : null
|
||||
}
|
||||
|
||||
function defalsify(val) {
|
||||
return val === 'false' ? false : val
|
||||
}
|
||||
|
||||
module.exports = function (sbot, id, cb) {
|
||||
var aboutByFeed = {}
|
||||
pull(
|
||||
@@ -25,7 +29,7 @@ module.exports = function (sbot, id, cb) {
|
||||
if (c.name) feedAbout.name = c.name.replace(/^@?/, '@')
|
||||
if (c.image) feedAbout.image = linkDest(c.image)
|
||||
if (c.description) feedAbout.description = c.description
|
||||
if (c.publicWebHosting && author == c.about) feedAbout.publicWebHosting = c.publicWebHosting
|
||||
if (c.publicWebHosting != null && author === c.about) feedAbout.publicWebHosting = defalsify(c.publicWebHosting)
|
||||
}, function (err) {
|
||||
if (err) return cb(err)
|
||||
// Use whatever properties have the most counts.
|
||||
|
||||
Reference in New Issue
Block a user