Publish noai, noindex or other_settings on activitypub
This commit is contained in:
parent
a4de9fcfdb
commit
062da7f31d
5 changed files with 34 additions and 11 deletions
|
@ -6,7 +6,8 @@ class REST::AccountSerializer < ActiveModel::Serializer
|
|||
|
||||
attributes :id, :username, :acct, :display_name, :locked, :bot, :discoverable, :group, :created_at,
|
||||
:note, :url, :avatar, :avatar_static, :header, :header_static, :searchability, :subscribable,
|
||||
:followers_count, :following_count, :statuses_count, :last_status_at, :other_settings
|
||||
:followers_count, :following_count, :statuses_count, :last_status_at, :other_settings,
|
||||
:noindex, :noai
|
||||
|
||||
has_one :moved_to_account, key: :moved, serializer: REST::AccountSerializer, if: :moved_and_not_nested?
|
||||
|
||||
|
@ -14,8 +15,6 @@ class REST::AccountSerializer < ActiveModel::Serializer
|
|||
|
||||
attribute :suspended, if: :suspended?
|
||||
attribute :silenced, key: :limited, if: :silenced?
|
||||
attribute :noindex, if: :local?
|
||||
attribute :noai, if: :local?
|
||||
|
||||
attribute :memorial, if: :memorial?
|
||||
|
||||
|
@ -144,11 +143,11 @@ class REST::AccountSerializer < ActiveModel::Serializer
|
|||
end
|
||||
|
||||
def noindex
|
||||
object.user_prefers_noindex?
|
||||
object.noindex?
|
||||
end
|
||||
|
||||
def noai
|
||||
object.user&.setting_noai
|
||||
object.noai?
|
||||
end
|
||||
|
||||
delegate :suspended?, :silenced?, :local?, :memorial?, to: :object
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue