about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
authormultiple creatures <dev@multiple-creature.party>2019-08-15 22:53:02 -0500
committermultiple creatures <dev@multiple-creature.party>2019-08-15 22:53:02 -0500
commit14cf223041031731d8ee48ec0e5bef5f26868bd2 (patch)
tree355aa220cd17739b584ed6889d15d14bd1dc74e1 /app
parent7bbcf793bc75b44f2b20de77b7774759af60cd90 (diff)
only drop posts matching a custom filter when the filter has no cw override set
Diffstat (limited to 'app')
-rw-r--r--app/helpers/filter_helper.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/app/helpers/filter_helper.rb b/app/helpers/filter_helper.rb
index ca5b32d1a..66ac5014d 100644
--- a/app/helpers/filter_helper.rb
+++ b/app/helpers/filter_helper.rb
@@ -2,7 +2,9 @@ module FilterHelper
   include Redisable
 
 	def phrase_filtered?(status, receiver_id, context)
-    return true if redis.sismember("filtered_statuses:#{receiver_id}", status.id)
+    if redis.sismember("filtered_statuses:#{receiver_id}", status.id)
+      return redis.hexists("custom_cw:#{receiver_id}", status.id)
+    end
 
     filters = cached_filters(receiver_id)
     filters.select! { |filter| filter.context.include?(context.to_s) && !filter.expired? }
@@ -38,7 +40,7 @@ module FilterHelper
       if matched
         filter_thread(receiver_id, status.conversation_id) if filter.thread
 
-        unless filter.custom_cw.nil?
+        unless filter.custom_cw.blank?
           cw = if filter.override_cw || status.spoiler_text.blank?
                  filter.custom_cw
                else
@@ -48,7 +50,7 @@ module FilterHelper
         end
 
         redis.sadd("filtered_statuses:#{receiver_id}", status.id)
-        return true
+        return filter.custom_cw.blank?
       end
     end