From 0513db12ab69d5643cf8d6c164ffc6e7dc83e7d2 Mon Sep 17 00:00:00 2001 From: KMY Date: Sat, 23 Sep 2023 12:34:47 +0900 Subject: [PATCH] Remove firefish but add meisskey as misskey fork --- app/lib/activitypub/activity/create.rb | 2 +- app/lib/status_reach_finder.rb | 2 +- .../activitypub/process_account_service.rb | 2 +- app/services/delivery_antenna_service.rb | 7 +--- .../services/delivery_antenna_service_spec.rb | 38 ------------------- 5 files changed, 4 insertions(+), 47 deletions(-) diff --git a/app/lib/activitypub/activity/create.rb b/app/lib/activitypub/activity/create.rb index f991faa6a6b039..691c57a5a92a1b 100644 --- a/app/lib/activitypub/activity/create.rb +++ b/app/lib/activitypub/activity/create.rb @@ -559,7 +559,7 @@ def misskey_software? info = instance_info return false if info.nil? - %w(misskey calckey firefish).include?(info.software) + %w(misskey calckey meisskey).include?(info.software) end def misskey_searchability diff --git a/app/lib/status_reach_finder.rb b/app/lib/status_reach_finder.rb index 7bdc300e1c8660..d280773041856c 100644 --- a/app/lib/status_reach_finder.rb +++ b/app/lib/status_reach_finder.rb @@ -159,7 +159,7 @@ def banned_domains_for_misskey def banned_domains_for_misskey_of_status(status) return [] unless (status.public_unlisted_visibility? && status.account.user&.setting_reject_public_unlisted_subscription) || (status.unlisted_visibility? && status.account.user&.setting_reject_unlisted_subscription) - from_info = InstanceInfo.where(software: %w(misskey calckey firefish)).pluck(:domain) + from_info = InstanceInfo.where(software: %w(misskey calckey meisskey)).pluck(:domain) from_domain_block = DomainBlock.where(detect_invalid_subscription: true).pluck(:domain) (from_info + from_domain_block).uniq end diff --git a/app/services/activitypub/process_account_service.rb b/app/services/activitypub/process_account_service.rb index d7859ba92dfa41..f55d10f2c249d7 100644 --- a/app/services/activitypub/process_account_service.rb +++ b/app/services/activitypub/process_account_service.rb @@ -305,7 +305,7 @@ def misskey_software? info = instance_info return false if info.nil? - %w(misskey calckey firefish).include?(info.software) + %w(misskey calckey meisskey).include?(info.software) end def subscribable_by diff --git a/app/services/delivery_antenna_service.rb b/app/services/delivery_antenna_service.rb index 53bcc226e7b3ab..3d263219954ac4 100644 --- a/app/services/delivery_antenna_service.rb +++ b/app/services/delivery_antenna_service.rb @@ -121,12 +121,7 @@ def followers_only? when :public, :public_unlisted, :login, :limited false when :unlisted - if @status.local? - !@status.public_searchability? - else - info = InstanceInfo.find_by(domain: @status.account.domain) - info&.software == 'firefish' || !@status.public_searchability? - end + !@status.public_searchability? else true end diff --git a/spec/services/delivery_antenna_service_spec.rb b/spec/services/delivery_antenna_service_spec.rb index e9620dc083bd30..224d448b1af040 100644 --- a/spec/services/delivery_antenna_service_spec.rb +++ b/spec/services/delivery_antenna_service_spec.rb @@ -362,42 +362,4 @@ def list(owner) expect(antenna_feed_of(antenna)).to include status.id end end - - context 'with federated unlisted post' do - let(:visibility) { :unlisted } - let(:searchability) { :public } - let(:domain) { 'fast.example.com' } - let!(:antenna) { antenna_with_keyword(bob, 'body') } - let!(:empty_antenna) { antenna_with_keyword(tom, 'body') } - - context 'when unknown domain' do - let(:software) { nil } - - it 'detecting antenna' do - expect(antenna_feed_of(antenna)).to include status.id - expect(antenna_feed_of(empty_antenna)).to include status.id - end - end - - context 'when misskey domain' do - let(:software) { 'misskey' } - - it 'detecting antenna' do - expect(antenna_feed_of(antenna)).to include status.id - expect(antenna_feed_of(empty_antenna)).to include status.id - end - end - - context 'when firefish domain' do - let(:software) { 'firefish' } - - it 'detecting antenna' do - expect(antenna_feed_of(antenna)).to include status.id - end - - it 'not detecting antenna' do - expect(antenna_feed_of(empty_antenna)).to_not include status.id - end - end - end end