Add limited visibilit post to lists
This commit is contained in:
parent
6168e50906
commit
c6fa8f6871
1 changed files with 10 additions and 0 deletions
|
@ -54,6 +54,7 @@ class FanOutOnWriteService < BaseService
|
|||
deliver_to_antennas! if [:public, :public_unlisted, :login].include?(@status.visibility.to_sym) && !@account.dissubscribable
|
||||
deliver_to_stl_antennas!
|
||||
when :limited
|
||||
deliver_to_lists_mentioned_accounts_only!
|
||||
deliver_to_mentioned_followers!
|
||||
else
|
||||
deliver_to_mentioned_followers!
|
||||
|
@ -123,6 +124,15 @@ class FanOutOnWriteService < BaseService
|
|||
end
|
||||
end
|
||||
|
||||
def deliver_to_lists_mentioned_accounts_only!
|
||||
mentioned_account_ids = @status.mentions.pluck(:account_id)
|
||||
@account.lists_for_local_distribution.where(account_id: mentioned_account_ids).select(:id).reorder(nil).find_in_batches do |lists|
|
||||
FeedInsertWorker.push_bulk(lists) do |list|
|
||||
[@status.id, list.id, 'list', { 'update' => update? }]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def deliver_to_stl_antennas!
|
||||
antennas = Antenna.available_stls
|
||||
antennas = antennas.where(account_id: Account.without_suspended.joins(:user).select('accounts.id').where('users.current_sign_in_at > ?', User::ACTIVE_DURATION.ago))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue