Merge commit '150f0fcba5585782e2cac49d971904f02d5e6fbd' into glitch-soc/merge-upstream

Conflicts:
- `app/controllers/follower_accounts_controller.rb`:
  Upstream refactored a part of the code where glitch-soc has changed the code
  to potentially hide followers count.
  Adapt upstream's changes.
This commit is contained in:
Claire
2025-09-29 18:41:46 +02:00
126 changed files with 595 additions and 188 deletions

View File

@@ -58,20 +58,22 @@ class FollowerAccountsController < ApplicationController
end
def collection_presenter
options = { type: :ordered }
options = {}
options[:size] = @account.followers_count unless Setting.hide_followers_count || @account.user&.setting_hide_followers_count
if page_requested?
ActivityPub::CollectionPresenter.new(
id: account_followers_url(@account, page: params.fetch(:page, 1)),
id: page_url(params.fetch(:page, 1)),
type: :ordered,
items: follows.map { |follow| ActivityPub::TagManager.instance.uri_for(follow.account) },
part_of: account_followers_url(@account),
part_of: ActivityPub::TagManager.instance.followers_uri_for(@account),
next: next_page_url,
prev: prev_page_url,
**options
)
else
ActivityPub::CollectionPresenter.new(
id: account_followers_url(@account),
id: ActivityPub::TagManager.instance.followers_uri_for(@account),
type: :ordered,
first: page_url(1),
**options
)