mirror of
https://github.com/glitch-soc/mastodon.git
synced 2024-11-15 20:54:01 -05: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
|