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 AuthorizeFollowService < BaseService
|
||||
include Payloadable
|
||||
|
||||
def call(source_account, target_account, **options)
|
||||
if options[:skip_follow_request]
|
||||
follow_request = FollowRequest.new(account: source_account, target_account: target_account, uri: options[:follow_request_uri])
|
||||
|
@ -24,11 +26,7 @@ class AuthorizeFollowService < BaseService
|
|||
end
|
||||
|
||||
def build_json(follow_request)
|
||||
ActiveModelSerializers::SerializableResource.new(
|
||||
follow_request,
|
||||
serializer: ActivityPub::AcceptFollowSerializer,
|
||||
adapter: ActivityPub::Adapter
|
||||
).to_json
|
||||
Oj.dump(serialize_payload(follow_request, ActivityPub::AcceptFollowSerializer))
|
||||
end
|
||||
|
||||
def build_xml(follow_request)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue