gearheads
/
mastodon
Archived
2
0
Fork 0
This repository has been archived on 2024-06-09. You can view files and clone it, but cannot push or open issues/pull-requests.
mastodon/app/lib/activitypub/activity/like.rb

13 lines
440 B
Ruby

# frozen_string_literal: true
class ActivityPub::Activity::Like < ActivityPub::Activity
def perform
original_status = status_from_uri(object_uri)
return if original_status.nil? || !original_status.account.local? || delete_arrived_first?(@json['id'])
favourite = original_status.favourites.where(account: @account).first_or_create!(account: @account)
NotifyService.new.call(original_status.account, favourite)
end
end