diff --git a/app/services/post_status_service.rb b/app/services/post_status_service.rb index bdc1bbb576cb19..bf2ba2cdbf9ea5 100644 --- a/app/services/post_status_service.rb +++ b/app/services/post_status_service.rb @@ -196,9 +196,9 @@ def postprocess_status! ProcessReferencesService.call_service(@status, @reference_ids, []) LinkCrawlWorker.perform_async(@status.id) DistributionWorker.perform_async(@status.id) - ActivityPub::DistributionWorker.perform_async(@status.id) + ActivityPub::DistributionWorker.perform_async(@status.id) unless @status.personal_limited? PollExpirationNotifyWorker.perform_at(@status.poll.expires_at, @status.poll.id) if @status.poll - GroupReblogService.new.call(@status) + GroupReblogService.new.call(@status) unless @status.personal_limited? end def validate_status! diff --git a/spec/services/post_status_service_spec.rb b/spec/services/post_status_service_spec.rb index a719b37e3de681..2e513b9ca40ef9 100644 --- a/spec/services/post_status_service_spec.rb +++ b/spec/services/post_status_service_spec.rb @@ -293,6 +293,19 @@ expect(ActivityPub::DistributionWorker).to have_received(:perform_async).with(status.id) end + it 'gets distributed when personal post' do + allow(DistributionWorker).to receive(:perform_async) + allow(ActivityPub::DistributionWorker).to receive(:perform_async) + + account = Fabricate(:account) + + empty_circle = Fabricate(:circle, account: account) + status = subject.call(account, text: 'test status update', visibility: 'circle', circle_id: empty_circle.id) + + expect(DistributionWorker).to have_received(:perform_async).with(status.id) + expect(ActivityPub::DistributionWorker).to_not have_received(:perform_async).with(status.id) + end + it 'crawls links' do allow(LinkCrawlWorker).to receive(:perform_async) account = Fabricate(:account)