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.

17 lines
544 B

  1. # frozen_string_literal: true
  2. class ActivityPub::MigratedFollowDeliveryWorker < ActivityPub::DeliveryWorker
  3. def perform(json, source_account_id, inbox_url, old_target_account_id, options = {})
  4. super(json, source_account_id, inbox_url, options)
  5. unfollow_old_account!(old_target_account_id)
  6. end
  7. private
  8. def unfollow_old_account!(old_target_account_id)
  9. old_target_account = Account.find(old_target_account_id)
  10. UnfollowService.new.call(@source_account, old_target_account, skip_unmerge: true)
  11. rescue
  12. true
  13. end
  14. end