about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFire Demon <firedemon@creature.cafe>2020-08-11 13:17:47 -0500
committerFire Demon <firedemon@creature.cafe>2020-08-30 05:45:17 -0500
commit04e405d0a420ce9cb722e9a2c28fc6276dc1e289 (patch)
tree6a6f25992fbd635b4e248d67ab91deb9c0b4ee18
parent163bc1a706e9a94687d28c885c1ff02089498b94 (diff)
[Privacy, Bug] Exclude unpublished statuses and replies from timeline generation
-rw-r--r--app/lib/feed_manager.rb3
-rw-r--r--app/policies/status_policy.rb2
2 files changed, 3 insertions, 2 deletions
diff --git a/app/lib/feed_manager.rb b/app/lib/feed_manager.rb
index f03d9d5af..b8ff7b0f8 100644
--- a/app/lib/feed_manager.rb
+++ b/app/lib/feed_manager.rb
@@ -197,7 +197,7 @@ class FeedManager
         next if last_status_score < oldest_home_score
       end
 
-      statuses = target_account.statuses.where(visibility: [:public, :unlisted, :private]).includes(:preloadable_poll, reblog: :account).limit(limit)
+      statuses = target_account.statuses.published.without_replies.where(visibility: [:public, :unlisted, :private]).includes(:preloadable_poll, reblog: :account).limit(limit)
       crutches = build_crutches(account.id, statuses)
 
       statuses.each do |status|
@@ -244,6 +244,7 @@ class FeedManager
 
   def filter_from_home?(status, receiver_id, crutches)
     return false if receiver_id == status.account_id
+    return true unless status.published?
     return true  if status.reply? && (status.in_reply_to_id.nil? || status.in_reply_to_account_id.nil?)
     return true  if phrase_filtered?(status, receiver_id, :home)
 
diff --git a/app/policies/status_policy.rb b/app/policies/status_policy.rb
index 80e06d820..082c27f8e 100644
--- a/app/policies/status_policy.rb
+++ b/app/policies/status_policy.rb
@@ -25,7 +25,7 @@ class StatusPolicy < ApplicationPolicy
   end
 
   def reblog?
-    published && !requires_mention? && (!private? || owned?) && show? && !blocking_author?
+    published? && !requires_mention? && (!private? || owned?) && show? && !blocking_author?
   end
 
   def favourite?