Fix output 0 as count when user set hide counts
This commit is contained in:
parent
a5fcacaded
commit
b50d851385
3 changed files with 5 additions and 5 deletions
|
@ -37,7 +37,7 @@ class ActivityPub::OutboxesController < ActivityPub::BaseController
|
|||
ActivityPub::CollectionPresenter.new(
|
||||
id: outbox_url,
|
||||
type: :ordered,
|
||||
size: @account.statuses_count,
|
||||
size: @account.user&.setting_hide_statuses_count ? 0 : @account.statuses_count,
|
||||
first: outbox_url(page: true),
|
||||
last: outbox_url(page: true, min_id: 0)
|
||||
)
|
||||
|
|
|
@ -63,7 +63,7 @@ class FollowerAccountsController < ApplicationController
|
|||
ActivityPub::CollectionPresenter.new(
|
||||
id: account_followers_url(@account, page: params.fetch(:page, 1)),
|
||||
type: :ordered,
|
||||
size: @account.followers_count,
|
||||
size: @account.user&.setting_hide_followers_count ? 0 : @account.followers_count,
|
||||
items: follows.map { |follow| ActivityPub::TagManager.instance.uri_for(follow.account) },
|
||||
part_of: account_followers_url(@account),
|
||||
next: next_page_url,
|
||||
|
@ -73,7 +73,7 @@ class FollowerAccountsController < ApplicationController
|
|||
ActivityPub::CollectionPresenter.new(
|
||||
id: account_followers_url(@account),
|
||||
type: :ordered,
|
||||
size: @account.followers_count,
|
||||
size: @account.user&.setting_hide_followers_count ? 0 : @account.followers_count,
|
||||
first: page_url(1)
|
||||
)
|
||||
end
|
||||
|
|
|
@ -66,7 +66,7 @@ class FollowingAccountsController < ApplicationController
|
|||
ActivityPub::CollectionPresenter.new(
|
||||
id: account_following_index_url(@account, page: params.fetch(:page, 1)),
|
||||
type: :ordered,
|
||||
size: @account.following_count,
|
||||
size: @account.user&.setting_hide_following_count ? 0 : @account.following_count,
|
||||
items: follows.map { |follow| ActivityPub::TagManager.instance.uri_for(follow.target_account) },
|
||||
part_of: account_following_index_url(@account),
|
||||
next: next_page_url,
|
||||
|
@ -76,7 +76,7 @@ class FollowingAccountsController < ApplicationController
|
|||
ActivityPub::CollectionPresenter.new(
|
||||
id: account_following_index_url(@account),
|
||||
type: :ordered,
|
||||
size: @account.following_count,
|
||||
size: @account.user&.setting_hide_following_count ? 0 : @account.following_count,
|
||||
first: page_url(1)
|
||||
)
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue