Add emoji icon support on notification (expects custom)
This commit is contained in:
parent
b242a89e63
commit
1df6e80ee0
5 changed files with 17 additions and 4 deletions
|
@ -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?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue