add `i:am` shortname to the client api

staging
multiple creatures 2019-07-28 19:29:24 -05:00
parent 9e841ece20
commit 30d3b9a6f7
1 changed files with 6 additions and 1 deletions

View File

@ -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, :signature
:adult_content, :gently, :kobold, :role, :froze, :identity, :signature
has_one :moved_to_account, key: :moved, serializer: REST::AccountSerializer, if: :moved_and_not_nested?
has_many :emojis, serializer: REST::CustomEmojiSerializer
@ -67,6 +67,11 @@ class REST::AccountSerializer < ActiveModel::Serializer
object.local? ? (object&.user.nil? ? true : object.user.disabled?) : object.froze?
end
def identity
return unless object.local? && object&.user.present?
object.user.vars['_they:are']
end
def signature
return unless object.local? && object&.user.present?
name = object.user.vars['_they:are']