git ssb

0+

Daan Patchwork / ssb-viewer



forked from cel / ssb-viewer

Commit ff87105bd1d53bd820af183f22245f91f965e9e2

Add ability to not be hosted publicly

Anders Rune Jensen committed on 12/19/2017, 11:10:39 AM
Parent: 9f0354990d92384a0a2d222469e672f428402bfd

Files changed

lib/about.jschanged
render.jschanged
lib/about.jsView
@@ -24,8 +24,9 @@
2424 var feedAbout = aboutByFeed[author] || (aboutByFeed[author] = {})
2525 if (c.name) feedAbout.name = c.name.replace(/^@?/, '@')
2626 if (c.image) feedAbout.image = linkDest(c.image)
2727 if (c.description) feedAbout.description = c.description
28+ if (c.publicWebHosting && author == c.about) feedAbout.publicWebHosting = c.publicWebHosting
2829 }, function (err) {
2930 if (err) return cb(err)
3031 // Use whatever properties have the most counts.
3132 // Usually we would want to handle renames for dead feeds and such,
render.jsView
@@ -113,8 +113,15 @@
113113 'Scuttlebutt')).outerHTML;
114114 }
115115
116116 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+
117124 opts.mentions = {};
118125 var figCaption = h('figcaption');
119126 figCaption.innerHTML = 'Feed of ' + about.name + '<br>' + marked(String(about.description), opts.marked);
120127 return pull(
@@ -337,8 +344,9 @@
337344 }
338345
339346 function renderMsg(opts, id, msg) {
340347 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;
341349 var c = msg.value.content || {};
342350 var name = encodeURIComponent(msg.key);
343351 return h('article#' + name,
344352 h('header',

Built with git-ssb-web