about summary refs log tree commit diff
path: root/app/controllers/following_accounts_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/following_accounts_controller.rb')
-rw-r--r--app/controllers/following_accounts_controller.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/app/controllers/following_accounts_controller.rb b/app/controllers/following_accounts_controller.rb
index 6c8fb84d8..95849ffb9 100644
--- a/app/controllers/following_accounts_controller.rb
+++ b/app/controllers/following_accounts_controller.rb
@@ -28,7 +28,8 @@ class FollowingAccountsController < ApplicationController
         render json: collection_presenter,
                serializer: ActivityPub::CollectionSerializer,
                adapter: ActivityPub::Adapter,
-               content_type: 'application/activity+json'
+               content_type: 'application/activity+json',
+               fields: restrict_fields_to
       end
     end
   end
@@ -71,4 +72,12 @@ class FollowingAccountsController < ApplicationController
       )
     end
   end
+
+  def restrict_fields_to
+    if page_requested? || !@account.user_hides_network?
+      # Return all fields
+    else
+      %i(id type totalItems)
+    end
+  end
 end