From 5f92c6429fac98e5c9e3b02d158b6d4eab89945d Mon Sep 17 00:00:00 2001 From: multiple creatures Date: Sat, 21 Dec 2019 13:59:38 -0600 Subject: add option to only apply phrase filters to timelines --- app/lib/status_filter.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'app/lib/status_filter.rb') diff --git a/app/lib/status_filter.rb b/app/lib/status_filter.rb index fb675cbbd..4cb5804da 100644 --- a/app/lib/status_filter.rb +++ b/app/lib/status_filter.rb @@ -15,9 +15,9 @@ class StatusFilter def filtered? return true if status.nil? || account.nil? return false if !account.nil? && account.id == status.account_id - return !account.user.invert_filters if redis.sismember("filtered_statuses:#{account.id}", status.id) + return !account.user.invert_filters if !account.user.filter_timelines_only && redis.sismember("filtered_statuses:#{account.id}", status.id) if blocked_by_policy? || (account_present? && filtered_status?) || silenced_account? - redis.sadd("filtered_statuses:#{account.id}", status.id) + redis.sadd("filtered_statuses:#{account.id}", status.id) unless account.user.filter_timelines_only return true end false @@ -40,7 +40,7 @@ class StatusFilter return true if account.user_hides_replies_of_blocker? && reply_to_blocker? # filtered by user? - return true if !account.user.invert_filters && phrase_filtered?(status, account.id) + return true if !account.user.filter_timelines_only && !account.user.invert_filters && phrase_filtered?(status, account.id) # kajiht has no filters if status has no mentions return false if status&.mentions.blank? @@ -77,7 +77,7 @@ class StatusFilter return true if !@preloaded_relations[:following] && (mentioned_account_ids - account.following_ids).any? # filtered by user? - account.user.invert_filters && !phrase_filtered?(status, account.id) + !account.user.filter_timelines_only && account.user.invert_filters && !phrase_filtered?(status, account.id) end def reply_to_blocked? -- cgit