1
0
Fork 0
forked from gitea/nas

Fix delivery limited posts

This commit is contained in:
KMY 2023-09-11 16:52:23 +09:00
parent b225cc1bdb
commit 6371fa6b9c
3 changed files with 4 additions and 2 deletions

View file

@ -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))
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)

View file

@ -57,6 +57,7 @@ class FanOutOnWriteService < BaseService
when :limited
deliver_to_lists_mentioned_accounts_only!
deliver_to_antennas! unless @account.dissubscribable
deliver_to_stl_antennas!
deliver_to_mentioned_followers!
else
deliver_to_mentioned_followers!

View file

@ -165,7 +165,7 @@ RSpec.describe FanOutOnWriteService, type: :service do
context 'with STL antenna' do
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
expect(antenna_feed_of(antenna)).to include status.id