about summary refs log tree commit diff
path: root/app/serializers/rest
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2022-05-11 09:37:48 +0200
committerClaire <claire.github-309c@sitedethib.com>2022-05-11 09:37:48 +0200
commit5fd8780b1429acd2bea908695e13c41375d189d7 (patch)
treec870d368c2a9d0bfd2176057c0b99dad48338248 /app/serializers/rest
parente8b8ac8908c6623f0fd7ffccc7de3882a773b72f (diff)
parent95555f15b55291b97477465f8d8a7eba526d6522 (diff)
Merge branch 'main' into glitch-soc/merge-upstream
Conflicts:
- `package.json`:
  Not really a conflict, upstream updated a dependency textually adjacent to a
  glitch-soc-only one.
  Updated the dependency as upstream did.
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 113e0cca7..e644a3f91 100644
--- a/app/serializers/rest/account_serializer.rb
+++ b/app/serializers/rest/account_serializer.rb
@@ -13,6 +13,7 @@ class REST::AccountSerializer < ActiveModel::Serializer
   has_many :emojis, serializer: REST::CustomEmojiSerializer
 
   attribute :suspended, if: :suspended?
+  attribute :silenced, key: :limited, if: :silenced?
 
   class FieldSerializer < ActiveModel::Serializer
     include FormattingHelper
@@ -102,7 +103,11 @@ class REST::AccountSerializer < ActiveModel::Serializer
     object.suspended?
   end
 
-  delegate :suspended?, to: :object
+  def silenced
+    object.silenced?
+  end
+
+  delegate :suspended?, :silenced?, to: :object
 
   def moved_and_not_nested?
     object.moved? && object.moved_to_account.moved_to_account_id.nil?