about summary refs log tree commit diff
path: root/app/controllers/api/v1/accounts/following_accounts_controller.rb
diff options
context:
space:
mode:
authorReverite <github@reverite.sh>2019-04-12 01:38:18 -0700
committerReverite <github@reverite.sh>2019-04-12 01:38:18 -0700
commite10a9794f4ed7c90e3190f285359f55dd00da435 (patch)
tree579ebf95d6bbf091d05e66907a9c8168c926e0af /app/controllers/api/v1/accounts/following_accounts_controller.rb
parentff736905fa534f7189e57c1d0c14fbac45f239a1 (diff)
parentbb50ec2e6687238ad8b2ec545a73270fee7a7b09 (diff)
Merge branch 'glitch' into production
Diffstat (limited to 'app/controllers/api/v1/accounts/following_accounts_controller.rb')
-rw-r--r--app/controllers/api/v1/accounts/following_accounts_controller.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/app/controllers/api/v1/accounts/following_accounts_controller.rb b/app/controllers/api/v1/accounts/following_accounts_controller.rb
index 0369cb25e..44e89804b 100644
--- a/app/controllers/api/v1/accounts/following_accounts_controller.rb
+++ b/app/controllers/api/v1/accounts/following_accounts_controller.rb
@@ -19,13 +19,17 @@ class Api::V1::Accounts::FollowingAccountsController < Api::BaseController
   end
 
   def load_accounts
-    return [] if @account.user_hides_network? && current_account.id != @account.id
+    return [] if hide_results?
 
     default_accounts.merge(paginated_follows).to_a
   end
 
+  def hide_results?
+    (@account.user_hides_network? && current_account.id != @account.id) || (current_account && @account.blocking?(current_account))
+  end
+
   def default_accounts
-    Account.without_blocking(current_account).includes(:passive_relationships, :account_stat).references(:passive_relationships)
+    Account.includes(:passive_relationships, :account_stat).references(:passive_relationships)
   end
 
   def paginated_follows