about summary refs log tree commit diff
path: root/app/controllers/api/v1/accounts/following_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/api/v1/accounts/following_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/api/v1/accounts/following_accounts_controller.rb')
-rw-r--r--app/controllers/api/v1/accounts/following_accounts_controller.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/controllers/api/v1/accounts/following_accounts_controller.rb b/app/controllers/api/v1/accounts/following_accounts_controller.rb
index b1433af5e..a405b365f 100644
--- a/app/controllers/api/v1/accounts/following_accounts_controller.rb
+++ b/app/controllers/api/v1/accounts/following_accounts_controller.rb
@@ -21,7 +21,9 @@ class Api::V1::Accounts::FollowingAccountsController < Api::BaseController
   def load_accounts
     return [] if hide_results?
 
-    default_accounts.merge(paginated_follows).to_a
+    scope = default_accounts
+    scope = scope.where.not(id: current_account.excluded_from_timeline_account_ids) unless current_account.nil?
+    scope.merge(paginated_follows).to_a
   end
 
   def hide_results?