Add login visibility
This commit is contained in:
parent
0907b67239
commit
20497e0c21
42 changed files with 106 additions and 47 deletions
|
@ -514,7 +514,7 @@ class ActivityPub::Activity::Create < ActivityPub::Activity
|
|||
|
||||
if searchability == visibility || searchability == :limited || searchability == :direct
|
||||
searchability
|
||||
elsif [:public, :unlisted, :private].include?(searchability) && [:public, :public_unlisted, :unlisted, :private].include?(visibility)
|
||||
elsif [:public, :unlisted, :private].include?(searchability) && [:public, :public_unlisted, :unlisted, :login, :private].include?(visibility)
|
||||
:private
|
||||
else
|
||||
:direct
|
||||
|
@ -526,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
|
||||
|
|
|
@ -86,7 +86,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?
|
||||
|
@ -124,6 +124,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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue