From c961429dc2895ba10f9498496e1d2d252d28df4d Mon Sep 17 00:00:00 2001 From: multiple creatures Date: Wed, 15 May 2019 16:18:58 -0500 Subject: Accounts, UI: Expose kobold badges over the API. Render badges in the web app. --- app/serializers/rest/account_serializer.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'app/serializers') diff --git a/app/serializers/rest/account_serializer.rb b/app/serializers/rest/account_serializer.rb index 04df81225..019bac26a 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, - :adults_only + :adults_only, :gentlies_kobolds, :is_a_kobold has_one :moved_to_account, key: :moved, serializer: REST::AccountSerializer, if: :moved_and_not_nested? has_many :emojis, serializer: REST::CustomEmojiSerializer @@ -56,4 +56,12 @@ class REST::AccountSerializer < ActiveModel::Serializer def followers_count (Setting.hide_followers_count || object.user&.setting_hide_followers_count) ? -1 : object.followers_count end + + def gentlies_kobolds + object.user_gentlies_kobolds? || false + end + + def is_a_kobold + object.user_is_a_kobold? || false + end end -- cgit