This repository has been archived on 2024-06-09. You can view files and clone it, but cannot push or open issues/pull-requests.
2017-08-08 21:52:15 +02:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class ActivityPub::Activity::Like < ActivityPub::Activity
|
|
|
|
def perform
|
|
|
|
original_status = status_from_uri(object_uri)
|
|
|
|
|
2017-08-20 16:53:47 +02:00
|
|
|
return if original_status.nil? || !original_status.account.local? || delete_arrived_first?(@json['id']) || @account.favourited?(original_status)
|
2017-08-08 21:52:15 +02:00
|
|
|
|
2017-08-20 16:53:47 +02:00
|
|
|
favourite = original_status.favourites.create!(account: @account)
|
2017-08-08 21:52:15 +02:00
|
|
|
NotifyService.new.call(original_status.account, favourite)
|
|
|
|
end
|
|
|
|
end
|