mirror of
https://git.kescher.at/CatCatNya/catstodon.git
synced 2024-11-24 19:48:06 +01:00
14 lines
541 B
Ruby
14 lines
541 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)
|
|
|
|
LocalNotificationWorker.perform_async(original_status.account_id, favourite.id, 'Favourite', 'favourite')
|
|
Trends.statuses.register(original_status)
|
|
end
|
|
end
|