Add hide someone setting

This commit is contained in:
KMY 2023-05-15 14:21:30 +09:00
parent 1bcf3e8c0b
commit a85fbcd471
8 changed files with 39 additions and 6 deletions

View file

@ -157,18 +157,18 @@ class REST::AccountSerializer < ActiveModel::Serializer
end
def statuses_count
object.settings.present? && object.settings['hide_statuses_count'] ? 0 : object.statuses_count
object.hide_statuses_count? ? 0 : object.statuses_count
end
def followers_count
object.settings.present? && object.settings['hide_followers_count'] ? 0 : object.followers_count
object.hide_followers_count? ? 0 : object.followers_count
end
def following_count
object.settings.present? && object.settings['hide_followers_count'] ? 0 : object.following_count
object.hide_following_count? ? 0 : object.following_count
end
def other_settings
object.suspended? || object.settings.nil? ? {} : object.settings
object.suspended? ? {} : object.public_settings
end
end