Merge branch 'kb_development' into kb_migration
This commit is contained in:
commit
9b032185b8
59 changed files with 1441 additions and 28 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -186,9 +186,13 @@ class ActivityPub::TagManager
|
|||
nil
|
||||
end
|
||||
|
||||
def subscribable_by(account)
|
||||
account.dissubscribable ? [] : [COLLECTIONS[:public]]
|
||||
end
|
||||
|
||||
def searchable_by(status)
|
||||
searchable_by =
|
||||
case status.compute_searchability
|
||||
case status.compute_searchability_activitypub
|
||||
when 'public'
|
||||
[COLLECTIONS[:public]]
|
||||
when 'unlisted' # Followers only in kmyblue (generics: private)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue