git ssb

0+

Daan Patchwork / ssb-viewer



forked from cel / ssb-viewer

Commit 2dcdef60a24ea6a888eee961f4c90e89cc87ca94

Don't show private messages in user-feed, its crowded enough already

Anders Rune Jensen committed on 12/18/2017, 8:53:17 PM
Parent: 1af70e26c5c2c60bc0fcb5b854621be9d1894a5a

Files changed

index.jschanged
render.jschanged
index.jsView
@@ -200,9 +200,9 @@
200200 paramap(addAuthorAbout, 8),
201201 paramap(addFollowAbout, 8),
202202 paramap(addVoteMessage, 8),
203203 paramap(addGitLinks, 8),
204- pull(renderThread(defaultOpts), wrapPage(name)),
204+ pull(renderThread(Object.assign({}, defaultOpts, { renderPrivate: false })), wrapPage(name)),
205205 toPull(res, function (err) {
206206 if (err) console.error('[viewer]', err)
207207 })
208208 )
render.jsView
@@ -114,11 +114,11 @@
114114 'Scuttlebutt')).outerHTML;
115115 }
116116
117117 function renderAbout(opts, about, showAllHTML = "") {
118- opts.mentions = {}
118+ opts.mentions = {};
119119 var figCaption = h('figcaption');
120- figCaption.innerHTML = 'Feed of ' + about.name + '<br>' + marked(String(about.description), opts.marked);
120+ figCaption.innerHTML = 'Feed of ' + about.name + '<br>' + marked(String(about.description), opts.marked);
121121 return pull(
122122 pull.map(renderMsg.bind(this, opts, '')),
123123 wrap(toolTipTop() + '<main>' +
124124 h('article',
@@ -337,8 +337,9 @@
337337 return "document.write(" + JSON.stringify(str) + ")\n";
338338 }
339339
340340 function renderMsg(opts, id, msg) {
341+ if (opts.renderPrivate == false && typeof(msg.value.content) == 'string') return ''
341342 var c = msg.value.content || {};
342343 var name = encodeURIComponent(msg.key);
343344 return h('article#' + name,
344345 h('header',

Built with git-ssb-web