Add limited-searchability activitypub support
This commit is contained in:
parent
c4e8af4417
commit
0907b67239
2 changed files with 12 additions and 6 deletions
|
@ -480,6 +480,8 @@ class ActivityPub::Activity::Create < ActivityPub::Activity
|
||||||
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')
|
||||||
|
:limited
|
||||||
elsif audience_searchable_by.include?(@account.followers_url)
|
elsif audience_searchable_by.include?(@account.followers_url)
|
||||||
:private
|
:private
|
||||||
else
|
else
|
||||||
|
@ -503,16 +505,16 @@ class ActivityPub::Activity::Create < ActivityPub::Activity
|
||||||
return nil if searchability.nil?
|
return nil if searchability.nil?
|
||||||
|
|
||||||
searchability = :public if searchability == 'public'
|
searchability = :public if searchability == 'public'
|
||||||
searchability = :unlisted if searchability == 'followers'
|
searchability = :private if searchability == 'followers'
|
||||||
searchability = :direct if searchability == 'private'
|
searchability = :limited if searchability == 'private'
|
||||||
searchability = :private if searchability == 'reactors'
|
searchability = :direct if searchability == 'reactors'
|
||||||
end
|
end
|
||||||
|
|
||||||
visibility = visibility_from_audience_with_silence
|
visibility = visibility_from_audience_with_silence
|
||||||
|
|
||||||
if searchability == visibility
|
if searchability == visibility || searchability == :limited || searchability == :direct
|
||||||
searchability
|
searchability
|
||||||
elsif [:public, :unlisted, :private].include?(searchability) && [:public, :unlisted, :private].include?(visibility)
|
elsif [:public, :unlisted, :private].include?(searchability) && [:public, :public_unlisted, :unlisted, :private].include?(visibility)
|
||||||
:private
|
:private
|
||||||
else
|
else
|
||||||
:direct
|
:direct
|
||||||
|
|
|
@ -217,6 +217,8 @@ class ActivityPub::TagManager
|
||||||
[account_followers_url(status.account)]
|
[account_followers_url(status.account)]
|
||||||
when 'direct'
|
when 'direct'
|
||||||
status.conversation_id.present? ? [uri_for(status.conversation)] : []
|
status.conversation_id.present? ? [uri_for(status.conversation)] : []
|
||||||
|
when 'limited'
|
||||||
|
['as:Limited']
|
||||||
else
|
else
|
||||||
[]
|
[]
|
||||||
end
|
end
|
||||||
|
@ -230,6 +232,8 @@ class ActivityPub::TagManager
|
||||||
[COLLECTIONS[:public]]
|
[COLLECTIONS[:public]]
|
||||||
when 'private', 'direct'
|
when 'private', 'direct'
|
||||||
[account_followers_url(account)]
|
[account_followers_url(account)]
|
||||||
|
when 'limited'
|
||||||
|
['as:Limited']
|
||||||
else
|
else
|
||||||
[]
|
[]
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue