about summary refs log tree commit diff
path: root/app/controllers/follower_accounts_controller.rb
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2019-12-31 00:55:32 +0100
committerEugen Rochko <eugen@zeonfederated.com>2019-12-31 00:55:32 +0100
commit3b3bdc7293493735a2169d3377a5a5b7d9006497 (patch)
treeba178a909b44087e3eb3842f77396d452eda1401 /app/controllers/follower_accounts_controller.rb
parent2999c955968c8d8a6b4a35d13f9b4e7f6769b014 (diff)
Hide blocked users from more places (#12733)
* Hide blocked, muted, and blocked-by users from toot favourite lists

* Hide blocked, muted, and blocked-by users from toot reblog lists

* Hide blocked, muted, and blocked-by users from followers/following (API)

* Fix tests

* Hide blocked, muted, and blocked-by users from followers/following on public pages
Diffstat (limited to 'app/controllers/follower_accounts_controller.rb')
-rw-r--r--app/controllers/follower_accounts_controller.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/controllers/follower_accounts_controller.rb b/app/controllers/follower_accounts_controller.rb
index ef183eca7..7103749ad 100644
--- a/app/controllers/follower_accounts_controller.rb
+++ b/app/controllers/follower_accounts_controller.rb
@@ -36,7 +36,11 @@ class FollowerAccountsController < ApplicationController
   private
 
   def follows
-    @follows ||= Follow.where(target_account: @account).recent.page(params[:page]).per(FOLLOW_PER_PAGE).preload(:account)
+    return @follows if defined?(@follows)
+
+    scope = Follow.where(target_account: @account)
+    scope = scope.where.not(account_id: current_account.excluded_from_timeline_account_ids) if user_signed_in?
+    @follows = scope.recent.page(params[:page]).per(FOLLOW_PER_PAGE).preload(:account)
   end
 
   def page_requested?