add.rb 466 B

1234567891011121314
  1. # frozen_string_literal: true
  2. class ActivityPub::Activity::Add < ActivityPub::Activity
  3. def perform
  4. return unless @json['target'].present? && value_or_id(@json['target']) == @account.featured_collection_url
  5. status = status_from_uri(object_uri)
  6. status ||= fetch_remote_original_status
  7. return unless !status.nil? && status.account_id == @account.id && !@account.pinned?(status)
  8. StatusPin.create!(account: @account, status: status)
  9. end
  10. end