Add support for numeric-based URIs for local accounts (#32724)

This commit is contained in:
Claire
2025-09-29 14:05:48 +02:00
committed by GitHub
parent 4d7c208da3
commit 150f0fcba5
20 changed files with 324 additions and 52 deletions

View File

@@ -49,7 +49,7 @@ class FollowingAccountsController < ApplicationController
end
def page_url(page)
account_following_index_url(@account, page: page) unless page.nil?
ActivityPub::TagManager.instance.following_uri_for(@account, page: page) unless page.nil?
end
def next_page_url
@@ -63,17 +63,17 @@ class FollowingAccountsController < ApplicationController
def collection_presenter
if page_requested?
ActivityPub::CollectionPresenter.new(
id: account_following_index_url(@account, page: params.fetch(:page, 1)),
id: page_url(params.fetch(:page, 1)),
type: :ordered,
size: @account.following_count,
items: follows.map { |follow| ActivityPub::TagManager.instance.uri_for(follow.target_account) },
part_of: account_following_index_url(@account),
part_of: ActivityPub::TagManager.instance.following_uri_for(@account),
next: next_page_url,
prev: prev_page_url
)
else
ActivityPub::CollectionPresenter.new(
id: account_following_index_url(@account),
id: ActivityPub::TagManager.instance.following_uri_for(@account),
type: :ordered,
size: @account.following_count,
first: page_url(1)