about summary refs log tree commit diff
path: root/app/controllers/following_accounts_controller.rb
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2020-03-22 17:59:47 +0100
committerGitHub <noreply@github.com>2020-03-22 17:59:47 +0100
commitd101438b9d1bd827c191605cb21d58f83de2124d (patch)
treeb36d73f45175add7aa114bb42fca5a528a9b24a4 /app/controllers/following_accounts_controller.rb
parent7115b0b8c99b7e88aee264be75945e592dec33e4 (diff)
parent9da4bd098cac88c3e44157765adcff01445ba31a (diff)
Merge pull request #1305 from ThibG/glitch-soc/merge-upstream
Merge upstream changes
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 ff23d97f9..4ddccf607 100644
--- a/app/controllers/following_accounts_controller.rb
+++ b/app/controllers/following_accounts_controller.rb
@@ -29,7 +29,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
@@ -72,4 +73,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