From 52e041222041c505e075dde27d488d6bf81cec8a Mon Sep 17 00:00:00 2001 From: Squawks Date: Mon, 1 Aug 2022 05:40:39 -0400 Subject: [PATCH] Added option for highlighting to override hiding --- src/Filtering/Filter.coffee | 4 ++++ src/Filtering/ThreadHiding.coffee | 2 +- src/classes/Thread.coffee | 1 + src/config/Config.coffee | 4 ++++ 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/Filtering/Filter.coffee b/src/Filtering/Filter.coffee index bcbd0e3602..01e29c060e 100644 --- a/src/Filtering/Filter.coffee +++ b/src/Filtering/Filter.coffee @@ -147,6 +147,9 @@ Filter = unless hl and filter.hl in hl (hl or= []).push filter.hl top or= filter.top + if filter.hl and Conf['Always Show Highlighted Threads'] + hide = false + hideable = false if filter.noti noti = true if hide @@ -164,6 +167,7 @@ Filter = ThreadHiding.hide @thread, stub else if hl + @thread.isHighlighted = true @highlights = hl $.addClass @nodes.root, hl... if noti and Unread.posts and (@ID > Unread.lastReadPost) and not QuoteYou.isYou(@) diff --git a/src/Filtering/ThreadHiding.coffee b/src/Filtering/ThreadHiding.coffee index bee113adff..4ada49e3a8 100644 --- a/src/Filtering/ThreadHiding.coffee +++ b/src/Filtering/ThreadHiding.coffee @@ -184,7 +184,7 @@ ThreadHiding = ThreadHiding.saveHiddenState thread hide: (thread, makeStub=Conf['Stubs']) -> - return if thread.isHidden + return if thread.isHidden or (thread.isHighlighted and Conf['Always Show Highlighted Threads']) threadRoot = thread.nodes.root thread.isHidden = true Index.updateHideLabel() diff --git a/src/classes/Thread.coffee b/src/classes/Thread.coffee index 90da7dbfc6..0f128e071d 100644 --- a/src/classes/Thread.coffee +++ b/src/classes/Thread.coffee @@ -10,6 +10,7 @@ class Thread @posts = new SimpleDict() @isDead = false @isHidden = false + @isHighlighted = false @isSticky = false @isClosed = false @isArchived = false diff --git a/src/config/Config.coffee b/src/config/Config.coffee index 4de0545c39..8f5d7659cc 100644 --- a/src/config/Config.coffee +++ b/src/config/Config.coffee @@ -213,6 +213,10 @@ Config = true 'Add buttons to hide single replies.' ] + 'Always Show Highlighted Threads': [ + false + 'Make thread highlighting override hiding.' + ] 'Stubs': [ true 'Show stubs of hidden threads / replies.'