Fix: #78 検索許可のas:Limited
をkmyblue:Limited
に変更
This commit is contained in:
parent
db98ef8a44
commit
0a91a3165d
5 changed files with 24 additions and 5 deletions
|
@ -198,7 +198,7 @@ class ActivityPub::Parser::StatusParser
|
||||||
nil
|
nil
|
||||||
elsif audience_searchable_by.any? { |uri| ActivityPub::TagManager.instance.public_collection?(uri) }
|
elsif audience_searchable_by.any? { |uri| ActivityPub::TagManager.instance.public_collection?(uri) }
|
||||||
:public
|
:public
|
||||||
elsif audience_searchable_by.include?('as:Limited')
|
elsif audience_searchable_by.include?('kmyblue:Limited') || audience_searchable_by.include?('as:Limited')
|
||||||
:limited
|
:limited
|
||||||
elsif audience_searchable_by.include?('LocalPublic')
|
elsif audience_searchable_by.include?('LocalPublic')
|
||||||
:public_unlisted
|
:public_unlisted
|
||||||
|
|
|
@ -249,7 +249,7 @@ class ActivityPub::TagManager
|
||||||
when 'direct'
|
when 'direct'
|
||||||
status.conversation_id.present? ? [uri_for(status.conversation)] : []
|
status.conversation_id.present? ? [uri_for(status.conversation)] : []
|
||||||
when 'limited'
|
when 'limited'
|
||||||
['as:Limited']
|
['as:Limited', 'kmyblue:Limited']
|
||||||
else
|
else
|
||||||
[]
|
[]
|
||||||
end
|
end
|
||||||
|
@ -270,7 +270,7 @@ class ActivityPub::TagManager
|
||||||
when 'private', 'direct'
|
when 'private', 'direct'
|
||||||
[account_followers_url(account)]
|
[account_followers_url(account)]
|
||||||
when 'limited'
|
when 'limited'
|
||||||
['as:Limited']
|
['as:Limited', 'kmyblue:Limited']
|
||||||
else
|
else
|
||||||
[]
|
[]
|
||||||
end
|
end
|
||||||
|
|
|
@ -272,7 +272,7 @@ class ActivityPub::ProcessAccountService < BaseService
|
||||||
:public
|
:public
|
||||||
elsif audience_searchable_by.include?(@account.followers_url)
|
elsif audience_searchable_by.include?(@account.followers_url)
|
||||||
:private
|
:private
|
||||||
elsif audience_searchable_by.include?('as:Limited')
|
elsif audience_searchable_by.include?('kmyblue:Limited') || audience_searchable_by.include?('as:Limited')
|
||||||
:limited
|
:limited
|
||||||
else
|
else
|
||||||
:direct
|
:direct
|
||||||
|
|
|
@ -475,6 +475,17 @@ RSpec.describe ActivityPub::Activity::Create do
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'with limited' do
|
context 'with limited' do
|
||||||
|
let(:searchable_by) { 'kmyblue:Limited' }
|
||||||
|
|
||||||
|
it 'create status' do
|
||||||
|
status = sender.statuses.first
|
||||||
|
|
||||||
|
expect(status).to_not be_nil
|
||||||
|
expect(status.searchability).to eq 'limited'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
context 'with limited old spec' do
|
||||||
let(:searchable_by) { 'as:Limited' }
|
let(:searchable_by) { 'as:Limited' }
|
||||||
|
|
||||||
it 'create status' do
|
it 'create status' do
|
||||||
|
@ -600,7 +611,7 @@ RSpec.describe ActivityPub::Activity::Create do
|
||||||
|
|
||||||
context 'with misskey' do
|
context 'with misskey' do
|
||||||
let(:sender_software) { 'misskey' }
|
let(:sender_software) { 'misskey' }
|
||||||
let(:searchable_by) { 'as:Limited' }
|
let(:searchable_by) { 'kmyblue:Limited' }
|
||||||
|
|
||||||
it 'create status' do
|
it 'create status' do
|
||||||
status = sender.statuses.first
|
status = sender.statuses.first
|
||||||
|
|
|
@ -54,6 +54,14 @@ RSpec.describe ActivityPub::ProcessAccountService, type: :service do
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'when limited' do
|
context 'when limited' do
|
||||||
|
let(:searchable_by) { 'kmyblue:Limited' }
|
||||||
|
|
||||||
|
it 'searchability is limited' do
|
||||||
|
expect(subject.searchability).to eq 'limited'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
context 'when limited old spec' do
|
||||||
let(:searchable_by) { 'as:Limited' }
|
let(:searchable_by) { 'as:Limited' }
|
||||||
|
|
||||||
it 'searchability is limited' do
|
it 'searchability is limited' do
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue