mirror of
https://github.com/lunaisnotaboy/mastodon.git
synced 2024-12-25 14:46:46 +00:00
8cf7006d4e
* Move ActivityPub::FetchRemoteAccountService to ActivityPub::FetchRemoteActorService ActivityPub::FetchRemoteAccountService is kept as a wrapper for when the actor is specifically required to be an Account * Refactor SignatureVerification to allow non-Account actors * fixup! Move ActivityPub::FetchRemoteAccountService to ActivityPub::FetchRemoteActorService * Refactor ActivityPub::FetchRemoteKeyService to potentially return non-Account actors * Refactor inbound ActivityPub payload processing to accept non-Account actors * Refactor inbound ActivityPub processing to accept activities relayed through non-Account * Refactor how Account key URIs are built * Refactor Request and drop unused key_id_format parameter * Rename ActivityPub::Dereferencer `signature_account` to `signature_actor`
21 lines
627 B
Ruby
21 lines
627 B
Ruby
# frozen_string_literal: true
|
|
|
|
class ActivityPub::ProcessingWorker
|
|
include Sidekiq::Worker
|
|
|
|
sidekiq_options backtrace: true, retry: 8
|
|
|
|
def perform(actor_id, body, delivered_to_account_id = nil, actor_type = 'Account')
|
|
case actor_type
|
|
when 'Account'
|
|
actor = Account.find_by(id: actor_id)
|
|
end
|
|
|
|
return if actor.nil?
|
|
|
|
ActivityPub::ProcessCollectionService.new.call(body, actor, override_timestamps: true, delivered_to_account_id: delivered_to_account_id, delivery: true)
|
|
rescue ActiveRecord::RecordInvalid => e
|
|
Rails.logger.debug "Error processing incoming ActivityPub object: #{e}"
|
|
end
|
|
end
|