From 30d3b9a6f7df8bd4e9811f2a4a23bae93362870d Mon Sep 17 00:00:00 2001 From: multiple creatures Date: Sun, 28 Jul 2019 19:29:24 -0500 Subject: add `i:am` shortname to the client api --- app/serializers/rest/account_serializer.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'app/serializers') diff --git a/app/serializers/rest/account_serializer.rb b/app/serializers/rest/account_serializer.rb index 2bfa73d90..afd6a9e4e 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, :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'] -- cgit