mirror of
https://github.com/mastodon/mastodon.git
synced 2024-08-20 21:08:15 -07:00
13 lines
440 B
Ruby
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
|