about summary refs log tree commit diff
path: root/app/helpers
diff options
context:
space:
mode:
authormultiple creatures <dev@multiple-creature.party>2020-01-10 20:07:15 -0600
committermultiple creatures <dev@multiple-creature.party>2020-01-10 20:07:15 -0600
commit1268277a8c203bcae515e0ccc8b3432119bafed2 (patch)
tree89fccc698a4a148f70a3ae10faf0ffef260200ec /app/helpers
parent0090aca0453285ed6f4d55758ccd05200025d11a (diff)
add custom filter master toggle, add media gallery mode, & fix various filter logic + caching bugs
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