Merge commit '9ffe6817e0
' into kb_migration
This commit is contained in:
commit
db5c358f4f
54 changed files with 155 additions and 79 deletions
|
@ -480,6 +480,8 @@ class ActivityPub::Activity::Create < ActivityPub::Activity
|
|||
nil
|
||||
elsif audience_searchable_by.any? { |uri| ActivityPub::TagManager.instance.public_collection?(uri) }
|
||||
:public
|
||||
elsif audience_searchable_by.include?('as:Limited')
|
||||
:limited
|
||||
elsif audience_searchable_by.include?(@account.followers_url)
|
||||
:private
|
||||
else
|
||||
|
@ -502,17 +504,17 @@ class ActivityPub::Activity::Create < ActivityPub::Activity
|
|||
searchability = searchability_bio[0]
|
||||
return nil if searchability.nil?
|
||||
|
||||
searchability = :public if searchability == 'public'
|
||||
searchability = :unlisted if searchability == 'followers'
|
||||
searchability = :direct if searchability == 'private'
|
||||
searchability = :private if searchability == 'reactors'
|
||||
searchability = :public if searchability == 'public'
|
||||
searchability = :private if searchability == 'followers'
|
||||
searchability = :limited if searchability == 'private'
|
||||
searchability = :direct if searchability == 'reactors'
|
||||
end
|
||||
|
||||
visibility = visibility_from_audience_with_silence
|
||||
|
||||
if searchability == visibility
|
||||
if searchability == visibility || searchability == :limited || searchability == :direct
|
||||
searchability
|
||||
elsif [:public, :unlisted, :private].include?(searchability) && [:public, :unlisted, :private].include?(visibility)
|
||||
elsif [:public, :unlisted, :private].include?(searchability) && [:public, :public_unlisted, :unlisted, :login, :private].include?(visibility)
|
||||
:private
|
||||
else
|
||||
:direct
|
||||
|
@ -524,6 +526,8 @@ class ActivityPub::Activity::Create < ActivityPub::Activity
|
|||
:public
|
||||
elsif audience_cc.any? { |cc| ActivityPub::TagManager.instance.public_collection?(cc) }
|
||||
:unlisted
|
||||
elsif audience_cc.include?('as:LoginOnly')
|
||||
:login
|
||||
elsif audience_to.include?(@account.followers_url)
|
||||
:private
|
||||
else
|
||||
|
|
|
@ -77,6 +77,8 @@ class ActivityPub::Parser::StatusParser
|
|||
:public
|
||||
elsif audience_cc.any? { |cc| ActivityPub::TagManager.instance.public_collection?(cc) }
|
||||
:unlisted
|
||||
elsif audience_cc.include?('as:LoginOnly')
|
||||
:login
|
||||
elsif audience_to.include?(@magic_values[:followers_collection])
|
||||
:private
|
||||
else
|
||||
|
|
|
@ -90,7 +90,7 @@ class ActivityPub::TagManager
|
|||
case status.visibility
|
||||
when 'public'
|
||||
[COLLECTIONS[:public]]
|
||||
when 'unlisted', 'public_unlisted', 'private'
|
||||
when 'unlisted', 'public_unlisted', 'login', 'private'
|
||||
[account_followers_url(status.account)]
|
||||
when 'direct', 'limited'
|
||||
if status.account.silenced?
|
||||
|
@ -128,6 +128,8 @@ class ActivityPub::TagManager
|
|||
cc << account_followers_url(status.account)
|
||||
when 'unlisted', 'public_unlisted'
|
||||
cc << COLLECTIONS[:public]
|
||||
when 'login'
|
||||
cc << 'as:LoginOnly'
|
||||
end
|
||||
|
||||
cc + cc_private_visibility(status)
|
||||
|
@ -221,6 +223,8 @@ class ActivityPub::TagManager
|
|||
[account_followers_url(status.account)]
|
||||
when 'direct'
|
||||
status.conversation_id.present? ? [uri_for(status.conversation)] : []
|
||||
when 'limited'
|
||||
['as:Limited']
|
||||
else
|
||||
[]
|
||||
end
|
||||
|
@ -234,6 +238,8 @@ class ActivityPub::TagManager
|
|||
[COLLECTIONS[:public]]
|
||||
when 'private', 'direct'
|
||||
[account_followers_url(account)]
|
||||
when 'limited'
|
||||
['as:Limited']
|
||||
else
|
||||
[]
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue