0
0
Fork 0

Add new public status index (#26344)

Co-authored-by: Eugen Rochko <eugen@zeonfederated.com>
Co-authored-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
jsgoldstein 2023-08-24 10:40:04 -04:00 committed by GitHub
parent 96bcee66fb
commit 30c191aaa0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
28 changed files with 584 additions and 87 deletions

View file

@ -8,13 +8,13 @@ class ActivityPub::ActorSerializer < ActivityPub::Serializer
context_extensions :manually_approves_followers, :featured, :also_known_as,
:moved_to, :property_value, :discoverable, :olm, :suspended,
:memorial
:memorial, :indexable
attributes :id, :type, :following, :followers,
:inbox, :outbox, :featured, :featured_tags,
:preferred_username, :name, :summary,
:url, :manually_approves_followers,
:discoverable, :published, :memorial
:discoverable, :indexable, :published, :memorial
has_one :public_key, serializer: ActivityPub::PublicKeySerializer
@ -99,6 +99,10 @@ class ActivityPub::ActorSerializer < ActivityPub::Serializer
object.suspended? ? false : (object.discoverable || false)
end
def indexable
object.suspended? ? false : (object.indexable || false)
end
def name
object.suspended? ? object.username : (object.display_name.presence || object.username)
end