mirror of
https://github.com/mastodon/mastodon.git
synced 2025-03-13 14:08:34 +01:00
Remove blocked users from ActivityPub replies collection
This commit is contained in:
parent
fe6511ee45
commit
ebf34263d7
1 changed files with 6 additions and 1 deletions
|
@ -30,7 +30,12 @@ class ActivityPub::RepliesController < ActivityPub::BaseController
|
|||
end
|
||||
|
||||
def set_replies
|
||||
@replies = only_other_accounts? ? Status.where.not(account_id: @account.id).joins(:account).merge(Account.without_suspended) : @account.statuses
|
||||
if only_other_accounts?
|
||||
@replies = Status.where.not(account_id: @account.id).joins(:account).merge(Account.without_suspended)
|
||||
@replies = @replies.joins("LEFT JOIN blocks ON blocks.account_id = #{@account.id} AND blocks.target_account_id = statuses.account_id").where(blocks: { id: nil })
|
||||
else
|
||||
@replies = @account.statuses
|
||||
end
|
||||
@replies = @replies.distributable_visibility.where(in_reply_to_id: @status.id)
|
||||
@replies = @replies.paginate_by_min_id(DESCENDANTS_LIMIT, params[:min_id])
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue