about summary refs log tree commit diff
path: root/app/serializers/rest
diff options
context:
space:
mode:
authormultiple creatures <dev@multiple-creature.party>2019-09-24 18:28:52 -0500
committermultiple creatures <dev@multiple-creature.party>2019-09-24 18:28:52 -0500
commitb50ab4778f7765fbc0454f5a67391438d111b9b3 (patch)
tree2295f38e4c1d23ff6d3c9f661cc31d5faf4b37f9 /app/serializers/rest
parent3d133d164146878048d703bc608f3ad6f6506ae4 (diff)
add account limited by admin flag to api + badge
Diffstat (limited to 'app/serializers/rest')
-rw-r--r--app/serializers/rest/account_serializer.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/app/serializers/rest/account_serializer.rb b/app/serializers/rest/account_serializer.rb
index afd6a9e4e..509b688db 100644
--- a/app/serializers/rest/account_serializer.rb
+++ b/app/serializers/rest/account_serializer.rb
@@ -6,7 +6,8 @@ class REST::AccountSerializer < ActiveModel::Serializer
   attributes :id, :username, :acct, :display_name, :locked, :bot, :created_at,
              :note, :url, :avatar, :avatar_static, :header, :header_static,
              :followers_count, :following_count, :statuses_count, :replies,
-             :adult_content, :gently, :kobold, :role, :froze, :identity, :signature
+             :adult_content, :gently, :kobold, :role, :froze, :identity,
+             :limited, :signature
 
   has_one :moved_to_account, key: :moved, serializer: REST::AccountSerializer, if: :moved_and_not_nested?
   has_many :emojis, serializer: REST::CustomEmojiSerializer
@@ -67,6 +68,10 @@ class REST::AccountSerializer < ActiveModel::Serializer
     object.local? ? (object&.user.nil? ? true : object.user.disabled?) : object.froze?
   end
 
+  def limited
+    object.silenced? || object.force_unlisted? || object.force_sensitive?
+  end
+
   def identity
     return unless object.local? && object&.user.present?
     object.user.vars['_they:are']