Fix activitypub searchability error
This commit is contained in:
parent
af20b1d2aa
commit
489eeb4aa7
1 changed files with 22 additions and 0 deletions
|
@ -464,4 +464,26 @@ class ActivityPub::Activity::Create < ActivityPub::Activity
|
|||
:direct
|
||||
end
|
||||
end
|
||||
|
||||
def visibility_from_audience
|
||||
if audience_to.any? { |to| ActivityPub::TagManager.instance.public_collection?(to) }
|
||||
:public
|
||||
elsif audience_cc.any? { |cc| ActivityPub::TagManager.instance.public_collection?(cc) }
|
||||
:unlisted
|
||||
elsif audience_to.include?(@account.followers_url)
|
||||
:private
|
||||
else
|
||||
:direct
|
||||
end
|
||||
end
|
||||
|
||||
def visibility_from_audience_with_silence
|
||||
visibility = visibility_from_audience
|
||||
|
||||
if @account.silenced? && %i(public).include?(visibility)
|
||||
:unlisted
|
||||
else
|
||||
visibility
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue