From ff87105bd1d53bd820af183f22245f91f965e9e2 Mon Sep 17 00:00:00 2001 From: Anders Rune Jensen Date: Tue, 19 Dec 2017 12:10:39 +0100 Subject: [PATCH] Add ability to not be hosted publicly --- lib/about.js | 1 + render.js | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/lib/about.js b/lib/about.js index eb424a8..8e151f4 100644 --- a/lib/about.js +++ b/lib/about.js @@ -25,6 +25,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 }, function (err) { if (err) return cb(err) // Use whatever properties have the most counts. diff --git a/render.js b/render.js index d15c091..3879f2f 100644 --- a/render.js +++ b/render.js @@ -114,6 +114,13 @@ function toolTipTop() { } function renderAbout(opts, about, showAllHTML = "") { + if (about.publicWebHosting == 'false') { + return pull( + pull.map(renderMsg.bind(this, opts, '')), + wrap(toolTipTop() + '
', '
' + callToAction()) + ); + } + opts.mentions = {}; var figCaption = h('figcaption'); figCaption.innerHTML = 'Feed of ' + about.name + '
' + marked(String(about.description), opts.marked); @@ -338,6 +345,7 @@ function docWrite(str) { function renderMsg(opts, id, msg) { if (opts.renderPrivate == false && typeof(msg.value.content) == 'string') return '' + if (msg.author.publicWebHosting == 'false') return h('article', 'User has chosen not to be hosted publicly').outerHTML; var c = msg.value.content || {}; var name = encodeURIComponent(msg.key); return h('article#' + name,