git ssb

9+

cel / ssb-viewer



Commit e6bc3b037ac455d656641e9e03e1ccba0a440ea0

Don't render channel subscribes in user-feed

Anders Rune Jensen committed on 1/11/2018, 3:20:07 PM
Parent: 2d14256b09e5676506a7bbfe4dae7c7e4017d7d8

Files changed

index.jschanged
render.jschanged
index.jsView
@@ -174,15 +174,21 @@
174174 delete channelSubscriptions[msg.value.content.channel]
175175 }
176176 })
177177
178- serveFeeds(req, res, following, channelSubscriptions, feedId, 'user feed ' + (about ? about.name : ""))
178 + serveFeeds(req, res, following, channelSubscriptions, feedId,
179 + 'user feed ' + (about ? about.name : ""))
179180 })
180181 )
181182 })
182183 }
183184
184185 function serveFeeds(req, res, following, channelSubscriptions, feedId, name) {
186 + var feedOpts = Object.assign({}, defaultOpts, {
187 + renderPrivate: false,
188 + renderSubscribe: false
189 + })
190 +
185191 pull(
186192 sbot.createLogStream({ reverse: true, limit: 5000 }),
187193 pull.filter((msg) => {
188194 return !msg.value ||
@@ -200,9 +206,9 @@
200206 paramap(addAuthorAbout, 8),
201207 paramap(addFollowAbout, 8),
202208 paramap(addVoteMessage, 8),
203209 paramap(addGitLinks, 8),
204- pull(renderThread(Object.assign({}, defaultOpts, { renderPrivate: false })), wrapPage(name)),
210 + pull(renderThread(feedOpts), wrapPage(name)),
205211 toPull(res, function (err) {
206212 if (err) console.error('[viewer]', err)
207213 })
208214 )
render.jsView
@@ -349,9 +349,11 @@
349349 }
350350
351351 function renderMsg(opts, id, msg) {
352352 if (opts.renderPrivate == false && typeof(msg.value.content) == 'string') return ''
353 + if (opts.renderSubscribe == false && msg.value.content.type == "channel" && msg.value.content.subscribed != undefined) return ''
353354 if (msg.author.publicWebHosting === false) return h('article', 'User has chosen not to be hosted publicly').outerHTML;
355 +
354356 var c = msg.value.content || {};
355357 var name = encodeURIComponent(msg.key);
356358 return h('article#' + name,
357359 h('header',

Built with git-ssb-web