From ed67b3e9682059d05b63e50cfa8afae9a61a552d Mon Sep 17 00:00:00 2001 From: pentargency Date: Sun, 19 Nov 2017 06:35:01 -0800 Subject: [PATCH 1/3] Added possible exception to filtering for posts made by user. Added configuration option to allow controlling behaviour: 'Filter Self', defaults to old behaviour (enabled) --- src/Filtering/Filter.coffee | 2 ++ src/config/Config.coffee | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/src/Filtering/Filter.coffee b/src/Filtering/Filter.coffee index ec55d5116..b3d026fb0 100644 --- a/src/Filtering/Filter.coffee +++ b/src/Filtering/Filter.coffee @@ -125,6 +125,8 @@ Filter = stub = true hl = undefined top = false + if !Conf['Filter Self'] and QuoteYou.isYou(post) + hideable = false for key of Filter.filters when ((value = Filter[key] post)?) # Continue if there's nothing to filter (no tripcode for example). for filter in Filter.filters[key] when (result = filter value, post.boardID, post.isReply) diff --git a/src/config/Config.coffee b/src/config/Config.coffee index df3b97ef2..966615731 100644 --- a/src/config/Config.coffee +++ b/src/config/Config.coffee @@ -179,6 +179,11 @@ Config = 'When enabled, shows backlinks to filtered posts with a line-through decoration. Otherwise, hides the backlinks.' 1 ] + 'Filter Self': [ + true + 'Also apply filters to posts known to be yours. (Remember Your Posts must be enabled)' + 1 + ] 'Recursive Hiding': [ true 'Hide replies of hidden posts, recursively.' From 5c73d039155f72b36b14465c4bfbe3bb6e491497 Mon Sep 17 00:00:00 2001 From: pentargency Date: Sun, 19 Nov 2017 07:53:40 -0800 Subject: [PATCH 2/3] Modified manner in which isYou accesses board and thread ID to fix issue with post objects not containing board and thread members on an index --- src/Quotelinks/QuoteYou.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Quotelinks/QuoteYou.coffee b/src/Quotelinks/QuoteYou.coffee index 5a5aa0a76..2f71ebd38 100644 --- a/src/Quotelinks/QuoteYou.coffee +++ b/src/Quotelinks/QuoteYou.coffee @@ -33,8 +33,8 @@ QuoteYou = isYou: (post) -> !!QuoteYou.db?.get { - boardID: post.board.ID - threadID: post.thread.ID + boardID: post.boardID + threadID: post.threadID postID: post.ID } From be6d7d9bfcf767bce601e84ec52175d00cb2dae4 Mon Sep 17 00:00:00 2001 From: pentargency Date: Sun, 19 Nov 2017 17:04:53 -0800 Subject: [PATCH 3/3] Removed user-facing 'filter self' option- filtering of own posts is now always disabled --- src/Filtering/Filter.coffee | 2 +- src/config/Config.coffee | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/Filtering/Filter.coffee b/src/Filtering/Filter.coffee index b3d026fb0..4e385bd92 100644 --- a/src/Filtering/Filter.coffee +++ b/src/Filtering/Filter.coffee @@ -125,7 +125,7 @@ Filter = stub = true hl = undefined top = false - if !Conf['Filter Self'] and QuoteYou.isYou(post) + if QuoteYou.isYou(post) hideable = false for key of Filter.filters when ((value = Filter[key] post)?) # Continue if there's nothing to filter (no tripcode for example). diff --git a/src/config/Config.coffee b/src/config/Config.coffee index 966615731..df3b97ef2 100644 --- a/src/config/Config.coffee +++ b/src/config/Config.coffee @@ -179,11 +179,6 @@ Config = 'When enabled, shows backlinks to filtered posts with a line-through decoration. Otherwise, hides the backlinks.' 1 ] - 'Filter Self': [ - true - 'Also apply filters to posts known to be yours. (Remember Your Posts must be enabled)' - 1 - ] 'Recursive Hiding': [ true 'Hide replies of hidden posts, recursively.'