* Change: `emoji_reaction_available_server`プロパティを`Status`から`Account`オブジェクトに移動する * Fix test
This commit is contained in:
parent
616d0c5267
commit
d315f23bed
8 changed files with 14 additions and 12 deletions
|
@ -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
|
||||
|
|
|
@ -6,7 +6,7 @@ class REST::StatusSerializer < ActiveModel::Serializer
|
|||
attributes :id, :created_at, :in_reply_to_id, :in_reply_to_account_id,
|
||||
:sensitive, :spoiler_text, :visibility, :visibility_ex, :limited_scope, :language,
|
||||
:uri, :url, :replies_count, :reblogs_count, :searchability, :markdown,
|
||||
:status_reference_ids, :status_references_count, :status_referred_by_count, :emoji_reaction_available_server,
|
||||
:status_reference_ids, :status_references_count, :status_referred_by_count,
|
||||
:favourites_count, :emoji_reactions, :emoji_reactions_count, :reactions, :edited_at
|
||||
|
||||
attribute :favourited, if: :current_user?
|
||||
|
@ -164,12 +164,6 @@ class REST::StatusSerializer < ActiveModel::Serializer
|
|||
end
|
||||
end
|
||||
|
||||
def emoji_reaction_available_server
|
||||
return Setting.enable_emoji_reaction if object.local?
|
||||
|
||||
InstanceInfo.emoji_reaction_available?(object.account.domain)
|
||||
end
|
||||
|
||||
def reactions
|
||||
emoji_reactions.tap do |rs|
|
||||
rs.each do |emoji_reaction|
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue