Create new stream event type: emoji_reaction

This commit is contained in:
KMY 2023-02-26 09:45:22 +09:00
parent 14fddebbd0
commit 1c028a20ac
15 changed files with 171 additions and 15 deletions

View file

@ -0,0 +1,23 @@
# frozen_string_literal: true
class ActivityPub::UndoEmojiReactionSerializer < ActivityPub::Serializer
attributes :id, :type, :actor, :content
has_one :object, serializer: ActivityPub::EmojiReactionSerializer
def id
[ActivityPub::TagManager.instance.uri_for(object.account), '#emoji_reactions/', object.id, '/undo'].join
end
def type
'Undo'
end
def actor
ActivityPub::TagManager.instance.uri_for(object.account)
end
def content
object.custom_emoji.nil? ? object.name : ":#{object.name}:"
end
end