mirror of
https://github.com/mastodon/mastodon.git
synced 2024-11-23 04:55:08 +01: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
|