mirror of
https://git.bsd.gay/fef/nyastodon.git
synced 2024-12-27 04:53:42 +01:00
fe5b66aa08
* Handle duplicate ActivityPub activities Only perform side-effects when record processed for the first time * Fast-forward repeat follow requests
12 lines
447 B
Ruby
12 lines
447 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']) || @account.favourited?(original_status)
|
|
|
|
favourite = original_status.favourites.create!(account: @account)
|
|
NotifyService.new.call(original_status.account, favourite)
|
|
end
|
|
end
|