Fix delivery limited posts
This commit is contained in:
parent
b225cc1bdb
commit
6371fa6b9c
3 changed files with 4 additions and 2 deletions
|
@ -76,7 +76,8 @@ class DeliveryAntennaService
|
||||||
antennas = antennas.where(account_id: Account.without_suspended.joins(:user).select('accounts.id').where('users.current_sign_in_at > ?', User::ACTIVE_DURATION.ago))
|
antennas = antennas.where(account_id: Account.without_suspended.joins(:user).select('accounts.id').where('users.current_sign_in_at > ?', User::ACTIVE_DURATION.ago))
|
||||||
|
|
||||||
home_post = !@account.domain.nil? || @status.reblog? || [:public, :public_unlisted, :login].exclude?(@status.visibility.to_sym)
|
home_post = !@account.domain.nil? || @status.reblog? || [:public, :public_unlisted, :login].exclude?(@status.visibility.to_sym)
|
||||||
antennas = antennas.where(account: @account.followers).or(antennas.where(account: @account)).where('insert_feeds IS FALSE OR list_id > 0') if home_post
|
antennas = antennas.where(account: @account.followers).or(antennas.where(account: @account)).where('insert_feeds IS FALSE OR list_id > 0') if home_post && !@status.limited_visibility?
|
||||||
|
antennas = antennas.where(account: @status.mentioned_accounts).or(antennas.where(account: @account)).where('insert_feeds IS FALSE OR list_id > 0') if @status.limited_visibility?
|
||||||
|
|
||||||
collection = AntennaCollection.new(@status, @update, home_post)
|
collection = AntennaCollection.new(@status, @update, home_post)
|
||||||
|
|
||||||
|
|
|
@ -57,6 +57,7 @@ class FanOutOnWriteService < BaseService
|
||||||
when :limited
|
when :limited
|
||||||
deliver_to_lists_mentioned_accounts_only!
|
deliver_to_lists_mentioned_accounts_only!
|
||||||
deliver_to_antennas! unless @account.dissubscribable
|
deliver_to_antennas! unless @account.dissubscribable
|
||||||
|
deliver_to_stl_antennas!
|
||||||
deliver_to_mentioned_followers!
|
deliver_to_mentioned_followers!
|
||||||
else
|
else
|
||||||
deliver_to_mentioned_followers!
|
deliver_to_mentioned_followers!
|
||||||
|
|
|
@ -165,7 +165,7 @@ RSpec.describe FanOutOnWriteService, type: :service do
|
||||||
|
|
||||||
context 'with STL antenna' do
|
context 'with STL antenna' do
|
||||||
let!(:antenna) { antenna_with_options(bob, stl: true) }
|
let!(:antenna) { antenna_with_options(bob, stl: true) }
|
||||||
let!(:empty_antenna) { antenna_with_options(ohagi, stl: true) }
|
let!(:empty_antenna) { antenna_with_options(tom, stl: true) }
|
||||||
|
|
||||||
it 'is added to the antenna feed of antenna follower' do
|
it 'is added to the antenna feed of antenna follower' do
|
||||||
expect(antenna_feed_of(antenna)).to include status.id
|
expect(antenna_feed_of(antenna)).to include status.id
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue