1
0
Fork 0
forked from gitea/nas

Add antenna and bio-searchability support

This commit is contained in:
KMY 2023-04-24 10:06:25 +09:00
parent 7e125b276f
commit 2fef21664b
35 changed files with 775 additions and 6 deletions

View file

@ -449,10 +449,26 @@ class ActivityPub::Activity::Create < ActivityPub::Activity
end
end
SCAN_SEARCHABILITY_RE = /\[searchability:(public|followers|reactors|private)\]/.freeze
def searchability
searchability = searchability_from_audience
return nil if searchability.nil?
if searchability.nil?
note = @account&.note
return nil unless note.present?
searchability_bio = note.scan(SCAN_SEARCHABILITY_RE).first
return nil unless searchability_bio
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'
end
visibility = visibility_from_audience_with_silence