mirror of
https://git.kescher.at/CatCatNya/catstodon.git
synced 2024-11-29 04:01:37 +01:00
758f9f6384
misskey federates emoji reactions as likes.
16 lines
569 B
Ruby
16 lines
569 B
Ruby
# frozen_string_literal: true
|
|
|
|
class ActivityPub::Activity::EmojiReact < ActivityPub::Activity
|
|
def perform
|
|
original_status = status_from_uri(object_uri)
|
|
name = @json['content']
|
|
return if original_status.nil? ||
|
|
!original_status.account.local? ||
|
|
delete_arrived_first?(@json['id']) ||
|
|
@account.reacted?(original_status, name)
|
|
|
|
reaction = original_status.status_reactions.create!(account: @account, name: name)
|
|
|
|
LocalNotificationWorker.perform_async(original_status.account_id, reaction.id, 'StatusReaction', 'reaction')
|
|
end
|
|
end
|