You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
440 B
13 lines
440 B
7 years ago
|
# 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
|