From dd805d691b245284cd78efe397f142753083f9db Mon Sep 17 00:00:00 2001 From: KMY Date: Mon, 15 Jan 2024 12:25:24 +0900 Subject: [PATCH] Fix test --- app/lib/status_reach_finder.rb | 11 +++++------ spec/services/remove_status_service_spec.rb | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/app/lib/status_reach_finder.rb b/app/lib/status_reach_finder.rb index b9e41ff1c4..76c4315b58 100644 --- a/app/lib/status_reach_finder.rb +++ b/app/lib/status_reach_finder.rb @@ -38,11 +38,8 @@ class StatusReachFinder private def reached_account_inboxes - if @status.limited_visibility? - Account.where(id: mentioned_account_ids).where.not(domain: banned_domains).inboxes - else - Account.where(id: reached_account_ids).inboxes - end + reject_domains = @status.limited_visibility? ? banned_domains : banned_domains + friend_domains + Account.where(id: reached_account_ids).where.not(domain: reject_domains).inboxes end def reached_account_inboxes_for_misskey @@ -67,6 +64,8 @@ class StatusReachFinder if @status.reblog? [reblog_of_account_id] + elsif @status.limited_visibility? + [mentioned_account_ids] else [ replied_to_account_id, @@ -203,7 +202,7 @@ class StatusReachFinder end def banned_domains_for_misskey - return @banned_domains_for_misskey if @banned_domains_for_misskey + return @banned_domains_for_misskey if defined?(@banned_domains_for_misskey) return @banned_domains_for_misskey = [] if (!@status.account.user&.setting_reject_public_unlisted_subscription && !@status.account.user&.setting_reject_unlisted_subscription) || (!@status.public_unlisted_visibility? && !@status.unlisted_visibility?) diff --git a/spec/services/remove_status_service_spec.rb b/spec/services/remove_status_service_spec.rb index cca506746c..dd88f047a1 100644 --- a/spec/services/remove_status_service_spec.rb +++ b/spec/services/remove_status_service_spec.rb @@ -176,7 +176,7 @@ RSpec.describe RemoveStatusService, :sidekiq_inline, type: :service do it 'sends Undo activity to followers' do subject.call(status) - expect(a_request(:post, bill.inbox_url).with( + expect(a_request(:post, bill.shared_inbox_url).with( body: hash_including({ 'type' => 'Undo', 'object' => hash_including({