Refactor all ActivityPub deliveries to be serialized and signed through one concern (#10966)
This commit is contained in:
parent
48fee1a800
commit
f2b743e715
24 changed files with 79 additions and 153 deletions
|
@ -1,6 +1,8 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AfterBlockDomainFromAccountService < BaseService
|
||||
include Payloadable
|
||||
|
||||
# This service does not create an AccountDomainBlock record,
|
||||
# it's meant to be called after such a record has been created
|
||||
# synchronously, to "clean up"
|
||||
|
@ -31,12 +33,6 @@ class AfterBlockDomainFromAccountService < BaseService
|
|||
|
||||
return unless follow.account.activitypub?
|
||||
|
||||
json = ActiveModelSerializers::SerializableResource.new(
|
||||
follow,
|
||||
serializer: ActivityPub::RejectFollowSerializer,
|
||||
adapter: ActivityPub::Adapter
|
||||
).to_json
|
||||
|
||||
ActivityPub::DeliveryWorker.perform_async(json, @account.id, follow.account.inbox_url)
|
||||
ActivityPub::DeliveryWorker.perform_async(Oj.dump(serialize_payload(follow, ActivityPub::RejectFollowSerializer)), @account.id, follow.account.inbox_url)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue