Add fedibird hide followers count support

This commit is contained in:
KMY 2023-05-14 12:44:41 +09:00
parent 56245f4ef8
commit 9818f6a0e1
10 changed files with 31 additions and 6 deletions

View file

@ -6,7 +6,7 @@ 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
:followers_count, :following_count, :statuses_count, :last_status_at, :other_settings
has_one :moved_to_account, key: :moved, serializer: REST::AccountSerializer, if: :moved_and_not_nested?
@ -123,6 +123,10 @@ class REST::AccountSerializer < ActiveModel::Serializer
object.suspended? ? [] : object.fields
end
def other_settings
object.suspended? || object.settings.nil? ? {} : object.settings
end
def suspended
object.suspended?
end