Add emoji icon support on notification (expects custom)

This commit is contained in:
KMY 2023-02-27 14:16:29 +09:00
parent b242a89e63
commit 1df6e80ee0
5 changed files with 17 additions and 4 deletions

View file

@ -1,15 +1,20 @@
# frozen_string_literal: true
class REST::EmojiReactionSerializer < ActiveModel::Serializer
attributes :name, :count
attributes :name
attribute :count, if: :count?
attribute :url, if: :custom_emoji?
attribute :static_url, if: :custom_emoji?
attribute :domain, if: :custom_emoji?
attribute :account_ids, if: :account_ids?
def count?
object.respond_to?(:count)
end
def custom_emoji?
object.url.present?
object.respond_to?(:url)
end
def account_ids?