Change: #428 emoji_reaction_available_serverプロパティをStatusからAccountオブジェクトに移動する (#434)

* Change: `emoji_reaction_available_server`プロパティを`Status`から`Account`オブジェクトに移動する

* Fix test
This commit is contained in:
KMY(雪あすか) 2024-01-09 10:43:59 +09:00 committed by GitHub
parent 616d0c5267
commit d315f23bed
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 14 additions and 12 deletions

View file

@ -7,7 +7,7 @@ class REST::AccountSerializer < ActiveModel::Serializer
# Please update `app/javascript/mastodon/api_types/accounts.ts` when making changes to the attributes
attributes :id, :username, :acct, :display_name, :locked, :bot, :discoverable, :indexable, :group, :created_at,
:note, :url, :uri, :avatar, :avatar_static, :header, :header_static, :subscribable,
:note, :url, :uri, :avatar, :avatar_static, :header, :header_static, :subscribable, :emoji_reaction_available_server,
:followers_count, :following_count, :statuses_count, :last_status_at, :hide_collections, :other_settings, :noindex
has_one :moved_to_account, key: :moved, serializer: REST::AccountSerializer, if: :moved_and_not_nested?
@ -119,6 +119,12 @@ class REST::AccountSerializer < ActiveModel::Serializer
object.unavailable? ? false : object.indexable
end
def emoji_reaction_available_server
return Setting.enable_emoji_reaction if object.local?
InstanceInfo.emoji_reaction_available?(object.domain)
end
def moved_to_account
object.unavailable? ? nil : AccountDecorator.new(object.moved_to_account)
end