about summary refs log tree commit diff
path: root/app/serializers/rest
diff options
context:
space:
mode:
authormultiple creatures <dev@multiple-creature.party>2019-07-28 19:06:02 -0500
committermultiple creatures <dev@multiple-creature.party>2019-07-28 19:06:02 -0500
commit9e841ece20e6cc96b466535e06f4f10678116186 (patch)
treea1db1f75b821c11bff01b8e0e7f00f21c635bf18 /app/serializers/rest
parent28b2a700f075328c8c559f35aaa862660e14266d (diff)
make `i:am`/`we:are` signatures available to the client api
Diffstat (limited to 'app/serializers/rest')
-rw-r--r--app/serializers/rest/account_serializer.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/app/serializers/rest/account_serializer.rb b/app/serializers/rest/account_serializer.rb
index 30fe4897f..2bfa73d90 100644
--- a/app/serializers/rest/account_serializer.rb
+++ b/app/serializers/rest/account_serializer.rb
@@ -6,7 +6,7 @@ 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
+             :adult_content, :gently, :kobold, :role, :froze, :signature
 
   has_one :moved_to_account, key: :moved, serializer: REST::AccountSerializer, if: :moved_and_not_nested?
   has_many :emojis, serializer: REST::CustomEmojiSerializer
@@ -66,4 +66,11 @@ class REST::AccountSerializer < ActiveModel::Serializer
   def froze
     object.local? ? (object&.user.nil? ? true : object.user.disabled?) : object.froze?
   end
+
+  def signature
+    return unless object.local? && object&.user.present?
+    name = object.user.vars['_they:are']
+    return if name.blank?
+    object.user.vars["_they:are:#{name}"]
+  end
 end