about summary refs log tree commit diff
path: root/app/helpers
diff options
context:
space:
mode:
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/filter_helper.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/app/helpers/filter_helper.rb b/app/helpers/filter_helper.rb
index b9dbc1f4f..2334fc356 100644
--- a/app/helpers/filter_helper.rb
+++ b/app/helpers/filter_helper.rb
@@ -1,14 +1,14 @@
 module FilterHelper
   include Redisable
 
-	def phrase_filtered?(status, receiver_id)
-    return true if redis.sismember("filtered_statuses:#{receiver_id}", status.id)
-    return false unless CustomFilter.where(account_id: receiver_id).exists?
+	def phrase_filtered?(status, receiver_id, skip_redis: false)
+    return true if !skip_redis && redis.sismember("filtered_statuses:#{receiver_id}", status.id)
+    return false unless CustomFilter.where(account_id: receiver_id, is_enabled: true).exists?
 
     status = status.reblog if status.reblog?
 
     if Status.where(id: status.id).search_filtered_by_account(receiver_id).exists?
-      redis.sadd("filtered_statuses:#{receiver_id}", status.id)
+      redis.sadd("filtered_statuses:#{receiver_id}", status.id) unless skip_redis
       return true
     end