Don't render channel subscribes in user-feed
This commit is contained in:
@@ -175,13 +175,19 @@ exports.init = function (sbot, config) {
|
||||
}
|
||||
})
|
||||
|
||||
serveFeeds(req, res, following, channelSubscriptions, feedId, 'user feed ' + (about ? about.name : ""))
|
||||
serveFeeds(req, res, following, channelSubscriptions, feedId,
|
||||
'user feed ' + (about ? about.name : ""))
|
||||
})
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
function serveFeeds(req, res, following, channelSubscriptions, feedId, name) {
|
||||
var feedOpts = Object.assign({}, defaultOpts, {
|
||||
renderPrivate: false,
|
||||
renderSubscribe: false
|
||||
})
|
||||
|
||||
pull(
|
||||
sbot.createLogStream({ reverse: true, limit: 5000 }),
|
||||
pull.filter((msg) => {
|
||||
@@ -201,7 +207,7 @@ exports.init = function (sbot, config) {
|
||||
paramap(addFollowAbout, 8),
|
||||
paramap(addVoteMessage, 8),
|
||||
paramap(addGitLinks, 8),
|
||||
pull(renderThread(Object.assign({}, defaultOpts, { renderPrivate: false })), wrapPage(name)),
|
||||
pull(renderThread(feedOpts), wrapPage(name)),
|
||||
toPull(res, function (err) {
|
||||
if (err) console.error('[viewer]', err)
|
||||
})
|
||||
|
||||
@@ -350,7 +350,9 @@ function docWrite(str) {
|
||||
|
||||
function renderMsg(opts, id, msg) {
|
||||
if (opts.renderPrivate == false && typeof(msg.value.content) == 'string') return ''
|
||||
if (opts.renderSubscribe == false && msg.value.content.type == "channel" && msg.value.content.subscribed != undefined) 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,
|
||||
|
||||
Reference in New Issue
Block a user