From f2b743e715758f6af818f68fb77cd44d2451ae48 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Tue, 4 Jun 2019 23:11:18 +0200 Subject: Refactor all ActivityPub deliveries to be serialized and signed through one concern (#10966) --- app/services/remove_status_service.rb | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'app/services/remove_status_service.rb') diff --git a/app/services/remove_status_service.rb b/app/services/remove_status_service.rb index 747f209f3..81adc5aae 100644 --- a/app/services/remove_status_service.rb +++ b/app/services/remove_status_service.rb @@ -3,6 +3,7 @@ class RemoveStatusService < BaseService include StreamEntryRenderer include Redisable + include Payloadable def call(status, **options) @payload = Oj.dump(event: :delete, payload: status.id.to_s) @@ -115,15 +116,7 @@ class RemoveStatusService < BaseService end def signed_activity_json - @signed_activity_json ||= Oj.dump(ActivityPub::LinkedDataSignature.new(activity_json).sign!(@account)) - end - - def activity_json - @activity_json ||= ActiveModelSerializers::SerializableResource.new( - @status, - serializer: @status.reblog? ? ActivityPub::UndoAnnounceSerializer : ActivityPub::DeleteSerializer, - adapter: ActivityPub::Adapter - ).as_json + @signed_activity_json ||= Oj.dump(serialize_payload(@status, @status.reblog? ? ActivityPub::UndoAnnounceSerializer : ActivityPub::DeleteSerializer, signer: @account)) end def remove_reblogs -- cgit