about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
authormultiple creatures <dev@multiple-creature.party>2020-02-01 10:52:51 -0600
committermultiple creatures <dev@multiple-creature.party>2020-02-01 10:52:51 -0600
commit0a5e08ebe765fe9b3d23b4aaef647368d8810b21 (patch)
treeec8617f34a63a3c29a0ca5211fe62547c5c41937 /app
parent389125d894b01a4049e22b6e49a1e84b524440a6 (diff)
**MAJOR**: fix access policy short-circuit bug caused by `fa8437f49` & `cb38a5899` - **if you are running a monsterfork revision between `fa8437f49` and `389125d89` upgrade or apply this patch immediately!
Diffstat (limited to 'app')
-rw-r--r--app/lib/status_filter.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/app/lib/status_filter.rb b/app/lib/status_filter.rb
index 6d65e2c00..80254ffb4 100644
--- a/app/lib/status_filter.rb
+++ b/app/lib/status_filter.rb
@@ -13,13 +13,15 @@ class StatusFilter
   end
 
   def filtered?
-    return true if status.nil?
-    return false if !account.nil? && account.id == status.account_id || account.nil?
+    return true if status.nil? || blocked_by_policy?
+    return false if account.nil? || account.id == status.account_id
     return true if redis.sismember("filtered_statuses:#{account.id}", status.id)
-    if blocked_by_policy? || (account_present? && filtered_status?) || silenced_account?
+
+    if filtered_status? || silenced_account?
       redis.sadd("filtered_statuses:#{account.id}", status.id)
       return true
     end
+
     false
   end