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

@ -7,13 +7,13 @@ class ActivityPub::ActorSerializer < ActivityPub::Serializer
context :security
context_extensions :manually_approves_followers, :featured, :also_known_as,
:moved_to, :property_value, :discoverable, :olm, :suspended, :searchable_by
:moved_to, :property_value, :discoverable, :olm, :suspended, :searchable_by, :subscribable_by
attributes :id, :type, :following, :followers,
:inbox, :outbox, :featured, :featured_tags,
:preferred_username, :name, :summary,
:url, :manually_approves_followers,
:discoverable, :published, :searchable_by
:discoverable, :published, :searchable_by, :subscribable_by
has_one :public_key, serializer: ActivityPub::PublicKeySerializer
@ -166,6 +166,10 @@ class ActivityPub::ActorSerializer < ActivityPub::Serializer
ActivityPub::TagManager.instance.account_searchable_by(object)
end
def subscribable_by
ActivityPub::TagManager.instance.subscribable_by(object)
end
class CustomEmojiSerializer < ActivityPub::EmojiSerializer
end

View file

@ -5,7 +5,7 @@ class REST::AccountSerializer < ActiveModel::Serializer
include FormattingHelper
attributes :id, :username, :acct, :display_name, :locked, :bot, :discoverable, :group, :created_at,
:note, :url, :avatar, :avatar_static, :header, :header_static, :searchability,
:note, :url, :avatar, :avatar_static, :header, :header_static, :searchability, :dissubscribable,
:followers_count, :following_count, :statuses_count, :last_status_at
has_one :moved_to_account, key: :moved, serializer: REST::AccountSerializer, if: :moved_and_not_nested?