about summary refs log tree commit diff
path: root/app/controllers/following_accounts_controller.rb
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2018-05-18 02:26:51 +0200
committerGitHub <noreply@github.com>2018-05-18 02:26:51 +0200
commit1e02dc871533de78174b48a6a527f11b0f2bc7ec (patch)
tree85342796b125279d75c6591ef8b9090a11b8b404 /app/controllers/following_accounts_controller.rb
parent919eef309820a421d6f5886b8ae811d3924cea97 (diff)
Add preference to hide following/followers lists (#7532)
* Add preference to hide following/followers lists

- Public pages
- ActivityPub collections (does not return pages but does give total)
- REST API (unless it's your own) (does not federate)

Fix #6901

* Add preference

* Add delegation

* Fix issue

* Fix issue
Diffstat (limited to 'app/controllers/following_accounts_controller.rb')
-rw-r--r--app/controllers/following_accounts_controller.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/controllers/following_accounts_controller.rb b/app/controllers/following_accounts_controller.rb
index 974d95c8e..03c4b1046 100644
--- a/app/controllers/following_accounts_controller.rb
+++ b/app/controllers/following_accounts_controller.rb
@@ -6,11 +6,15 @@ class FollowingAccountsController < ApplicationController
   def index
     respond_to do |format|
       format.html do
+        next if @account.user_hides_network?
+
         follows
         @relationships = AccountRelationshipsPresenter.new(follows.map(&:target_account_id), current_user.account_id) if user_signed_in?
       end
 
       format.json do
+        raise Mastodon::NotPermittedError if params[:page].present? && @account.user_hides_network?
+
         render json: collection_presenter,
                serializer: ActivityPub::CollectionSerializer,
                adapter: ActivityPub::Adapter,