mirror of
https://git.bsd.gay/fef/nyastodon.git
synced 2024-12-28 05:23:41 +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
|