Add federation support for the "hide network" preference (#11673)
* Change ActivityPub follower/following collections to not link first page * Add support for hiding followers and following of remote users * Switch to using a single `hide_collections` column * Address code style remarks
This commit is contained in:
parent
9660aa4543
commit
b154428e14
8 changed files with 55 additions and 11 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue