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
|
@ -3,6 +3,7 @@
|
|||
class ReblogService < BaseService
|
||||
include Authorization
|
||||
include StreamEntryRenderer
|
||||
include Payloadable
|
||||
|
||||
# Reblog a status and notify its remote author
|
||||
# @param [Account] account Account to reblog from
|
||||
|
@ -53,10 +54,6 @@ class ReblogService < BaseService
|
|||
end
|
||||
|
||||
def build_json(reblog)
|
||||
Oj.dump(ActivityPub::LinkedDataSignature.new(ActiveModelSerializers::SerializableResource.new(
|
||||
reblog,
|
||||
serializer: ActivityPub::ActivitySerializer,
|
||||
adapter: ActivityPub::Adapter
|
||||
).as_json).sign!(reblog.account))
|
||||
Oj.dump(serialize_payload(reblog, ActivityPub::ActivitySerializer, signer: reblog.account))
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue