#79 LocalPublic
をkmyblue:LocalPublic
に変更
This commit is contained in:
parent
d93c64b6e1
commit
6823ae3bae
4 changed files with 14 additions and 14 deletions
|
@ -77,7 +77,7 @@ class ActivityPub::Parser::StatusParser
|
||||||
def visibility
|
def visibility
|
||||||
if audience_to.any? { |to| ActivityPub::TagManager.instance.public_collection?(to) }
|
if audience_to.any? { |to| ActivityPub::TagManager.instance.public_collection?(to) }
|
||||||
:public
|
:public
|
||||||
elsif audience_to.include?('LocalPublic') && @friend
|
elsif audience_to.include?('kmyblue:LocalPublic') && @friend
|
||||||
:public_unlisted
|
:public_unlisted
|
||||||
elsif audience_cc.any? { |cc| ActivityPub::TagManager.instance.public_collection?(cc) }
|
elsif audience_cc.any? { |cc| ActivityPub::TagManager.instance.public_collection?(cc) }
|
||||||
:unlisted
|
:unlisted
|
||||||
|
@ -201,7 +201,7 @@ class ActivityPub::Parser::StatusParser
|
||||||
:public
|
:public
|
||||||
elsif audience_searchable_by.include?('kmyblue:Limited') || 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') && @friend
|
elsif audience_searchable_by.include?('kmyblue:LocalPublic') && @friend
|
||||||
:public_unlisted
|
:public_unlisted
|
||||||
elsif audience_searchable_by.include?(@account.followers_url)
|
elsif audience_searchable_by.include?(@account.followers_url)
|
||||||
:private
|
:private
|
||||||
|
|
|
@ -128,7 +128,7 @@ class ActivityPub::TagManager
|
||||||
|
|
||||||
def to_for_friend(status)
|
def to_for_friend(status)
|
||||||
to = to(status)
|
to = to(status)
|
||||||
to << 'LocalPublic' if status.public_unlisted_visibility?
|
to << 'kmyblue:LocalPublic' if status.public_unlisted_visibility?
|
||||||
to
|
to
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -259,7 +259,7 @@ class ActivityPub::TagManager
|
||||||
|
|
||||||
def searchable_by_for_friend(status)
|
def searchable_by_for_friend(status)
|
||||||
searchable = searchable_by(status)
|
searchable = searchable_by(status)
|
||||||
searchable << 'LocalPublic' if status.compute_searchability_local == 'public_unlisted'
|
searchable << 'kmyblue:LocalPublic' if status.compute_searchability_local == 'public_unlisted'
|
||||||
searchable
|
searchable
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -236,13 +236,13 @@ RSpec.describe ActivityPub::Activity::Create do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'when public_unlisted with LocalPublic' do
|
context 'when public_unlisted with kmyblue:LocalPublic' do
|
||||||
let(:object_json) do
|
let(:object_json) do
|
||||||
{
|
{
|
||||||
id: [ActivityPub::TagManager.instance.uri_for(sender), '#bar'].join,
|
id: [ActivityPub::TagManager.instance.uri_for(sender), '#bar'].join,
|
||||||
type: 'Note',
|
type: 'Note',
|
||||||
content: 'Lorem ipsum',
|
content: 'Lorem ipsum',
|
||||||
to: ['http://example.com/followers', 'LocalPublic'],
|
to: ['http://example.com/followers', 'kmyblue:LocalPublic'],
|
||||||
cc: 'https://www.w3.org/ns/activitystreams#Public',
|
cc: 'https://www.w3.org/ns/activitystreams#Public',
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
@ -255,13 +255,13 @@ RSpec.describe ActivityPub::Activity::Create do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'when public_unlisted with LocalPublic from friend-server' do
|
context 'when public_unlisted with kmyblue:LocalPublic from friend-server' do
|
||||||
let(:object_json) do
|
let(:object_json) do
|
||||||
{
|
{
|
||||||
id: [ActivityPub::TagManager.instance.uri_for(sender), '#bar'].join,
|
id: [ActivityPub::TagManager.instance.uri_for(sender), '#bar'].join,
|
||||||
type: 'Note',
|
type: 'Note',
|
||||||
content: 'Lorem ipsum',
|
content: 'Lorem ipsum',
|
||||||
to: ['http://example.com/followers', 'LocalPublic'],
|
to: ['http://example.com/followers', 'kmyblue:LocalPublic'],
|
||||||
cc: 'https://www.w3.org/ns/activitystreams#Public',
|
cc: 'https://www.w3.org/ns/activitystreams#Public',
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
@ -452,8 +452,8 @@ RSpec.describe ActivityPub::Activity::Create do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'with public_unlisted with LocalPublic' do
|
context 'with public_unlisted with kmyblue:LocalPublic' do
|
||||||
let(:searchable_by) { ['http://example.com/followers', 'LocalPublic'] }
|
let(:searchable_by) { ['http://example.com/followers', 'kmyblue:LocalPublic'] }
|
||||||
|
|
||||||
it 'create status' do
|
it 'create status' do
|
||||||
status = sender.statuses.first
|
status = sender.statuses.first
|
||||||
|
@ -463,8 +463,8 @@ RSpec.describe ActivityPub::Activity::Create do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'with public_unlisted with LocalPublic from friend-server' do
|
context 'with public_unlisted with kmyblue:LocalPublic from friend-server' do
|
||||||
let(:searchable_by) { ['http://example.com/followers', 'LocalPublic'] }
|
let(:searchable_by) { ['http://example.com/followers', 'kmyblue:LocalPublic'] }
|
||||||
let(:active_friend) { true }
|
let(:active_friend) { true }
|
||||||
|
|
||||||
it 'create status' do
|
it 'create status' do
|
||||||
|
|
|
@ -77,7 +77,7 @@ RSpec.describe ActivityPub::TagManager do
|
||||||
describe '#to_for_friend' do
|
describe '#to_for_friend' do
|
||||||
it 'returns followers collection for public_unlisted status' do
|
it 'returns followers collection for public_unlisted status' do
|
||||||
status = Fabricate(:status, visibility: :public_unlisted)
|
status = Fabricate(:status, visibility: :public_unlisted)
|
||||||
expect(subject.to_for_friend(status)).to eq [account_followers_url(status.account), 'LocalPublic']
|
expect(subject.to_for_friend(status)).to eq [account_followers_url(status.account), 'kmyblue:LocalPublic']
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'returns followers collection for unlisted status' do
|
it 'returns followers collection for unlisted status' do
|
||||||
|
@ -200,7 +200,7 @@ RSpec.describe ActivityPub::TagManager do
|
||||||
|
|
||||||
it 'returns public collection for public_unlisted status' do
|
it 'returns public collection for public_unlisted status' do
|
||||||
status = Fabricate(:status, account: Fabricate(:account, searchability: :public), searchability: :public_unlisted)
|
status = Fabricate(:status, account: Fabricate(:account, searchability: :public), searchability: :public_unlisted)
|
||||||
expect(subject.searchable_by_for_friend(status)).to eq [account_followers_url(status.account), 'LocalPublic']
|
expect(subject.searchable_by_for_friend(status)).to eq [account_followers_url(status.account), 'kmyblue:LocalPublic']
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'returns followers collection for private status' do
|
it 'returns followers collection for private status' do
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue