logo

mastofe

My custom branche(s) on git.pleroma.social/pleroma/mastofe git clone https://hacktivis.me/git/mastofe.git

like.rb (447B)


  1. # frozen_string_literal: true
  2. class ActivityPub::Activity::Like < ActivityPub::Activity
  3. def perform
  4. original_status = status_from_uri(object_uri)
  5. return if original_status.nil? || !original_status.account.local? || delete_arrived_first?(@json['id']) || @account.favourited?(original_status)
  6. favourite = original_status.favourites.create!(account: @account)
  7. NotifyService.new.call(original_status.account, favourite)
  8. end
  9. end