mirror of
https://github.com/mastodon/mastodon.git
synced 2024-11-24 14:56:27 +00:00
974b1b79ce
* Add bell button Fix #4890 * Remove duplicate type from post-deployment migration * Fix legacy class type mappings * Improve query performance with better index * Fix validation * Remove redundant index from notifications
13 lines
459 B
Ruby
13 lines
459 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, favourite)
|
|
end
|
|
end
|