Commit ff87105bd1d53bd820af183f22245f91f965e9e2
Add ability to not be hosted publicly
Anders Rune Jensen committed on 12/19/2017, 11:10:39 AMParent: 9f0354990d92384a0a2d222469e672f428402bfd
Files changed
lib/about.js | changed |
render.js | changed |
lib/about.js | ||
---|---|---|
@@ -24,8 +24,9 @@ | ||
24 | 24 | var feedAbout = aboutByFeed[author] || (aboutByFeed[author] = {}) |
25 | 25 | if (c.name) feedAbout.name = c.name.replace(/^@?/, '@') |
26 | 26 | if (c.image) feedAbout.image = linkDest(c.image) |
27 | 27 | if (c.description) feedAbout.description = c.description |
28 | + if (c.publicWebHosting && author == c.about) feedAbout.publicWebHosting = c.publicWebHosting | |
28 | 29 | }, function (err) { |
29 | 30 | if (err) return cb(err) |
30 | 31 | // Use whatever properties have the most counts. |
31 | 32 | // Usually we would want to handle renames for dead feeds and such, |
render.js | ||
---|---|---|
@@ -113,8 +113,15 @@ | ||
113 | 113 | 'Scuttlebutt')).outerHTML; |
114 | 114 | } |
115 | 115 | |
116 | 116 | function renderAbout(opts, about, showAllHTML = "") { |
117 | + if (about.publicWebHosting == 'false') { | |
118 | + return pull( | |
119 | + pull.map(renderMsg.bind(this, opts, '')), | |
120 | + wrap(toolTipTop() + '<main>', '</main>' + callToAction()) | |
121 | + ); | |
122 | + } | |
123 | + | |
117 | 124 | opts.mentions = {}; |
118 | 125 | var figCaption = h('figcaption'); |
119 | 126 | figCaption.innerHTML = 'Feed of ' + about.name + '<br>' + marked(String(about.description), opts.marked); |
120 | 127 | return pull( |
@@ -337,8 +344,9 @@ | ||
337 | 344 | } |
338 | 345 | |
339 | 346 | function renderMsg(opts, id, msg) { |
340 | 347 | if (opts.renderPrivate == false && typeof(msg.value.content) == 'string') return '' |
348 | + if (msg.author.publicWebHosting == 'false') return h('article', 'User has chosen not to be hosted publicly').outerHTML; | |
341 | 349 | var c = msg.value.content || {}; |
342 | 350 | var name = encodeURIComponent(msg.key); |
343 | 351 | return h('article#' + name, |
344 | 352 | h('header', |
Built with git-ssb-web