Create new stream event type: emoji_reaction
This commit is contained in:
parent
14fddebbd0
commit
1c028a20ac
15 changed files with 171 additions and 15 deletions
|
@ -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
|
Loading…
Add table
Add a link
Reference in a new issue