From c473e0163897c1f45aa6608d9736113a68595512 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Sun, 3 Apr 2016 23:44:06 -0700 Subject: [PATCH] ReplyPruning: Don't hide linked-to posts in the first place, and don't hide when opening thread by OP link. --- src/Monitoring/ReplyPruning.coffee | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Monitoring/ReplyPruning.coffee b/src/Monitoring/ReplyPruning.coffee index f98bf2265..6321fb2e0 100644 --- a/src/Monitoring/ReplyPruning.coffee +++ b/src/Monitoring/ReplyPruning.coffee @@ -62,6 +62,15 @@ ReplyPruning = ReplyPruning.total++ ReplyPruning.totalFiles++ if post.file + # If we're linked to a post that we would hide, don't hide the posts in the first place. + # Also don't hide posts if we open the thread by a link to the OP. + if ( + ReplyPruning.active and + /^#p\d+$/.test(location.hash) and + 0 <= @posts.keys.indexOf(location.hash[2..]) < 1 + Math.max(ReplyPruning.total - +Conf["Max Replies"], 0) + ) + ReplyPruning.active = ReplyPruning.inputs.enabled.checked = false + $.after @OP.nodes.root, ReplyPruning.summary $.on ReplyPruning.inputs.enabled, 'change', ReplyPruning.update