about summary refs log tree commit diff
path: root/app/models/form/account_batch.rb
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2019-06-04 23:11:18 +0200
committerGitHub <noreply@github.com>2019-06-04 23:11:18 +0200
commitf2b743e715758f6af818f68fb77cd44d2451ae48 (patch)
tree9221aaac28376655038631851da7228c040b2077 /app/models/form/account_batch.rb
parent48fee1a800a262ce26171d724c15738d083eb6d6 (diff)
Refactor all ActivityPub deliveries to be serialized and signed through one concern (#10966)
Diffstat (limited to 'app/models/form/account_batch.rb')
-rw-r--r--app/models/form/account_batch.rb9
1 files changed, 2 insertions, 7 deletions
diff --git a/app/models/form/account_batch.rb b/app/models/form/account_batch.rb
index 5bc44e809..f1b7a4566 100644
--- a/app/models/form/account_batch.rb
+++ b/app/models/form/account_batch.rb
@@ -3,6 +3,7 @@
 class Form::AccountBatch
   include ActiveModel::Model
   include Authorization
+  include Payloadable
 
   attr_accessor :account_ids, :action, :current_account
 
@@ -54,13 +55,7 @@ class Form::AccountBatch
 
     return unless follow.account.activitypub?
 
-    json = ActiveModelSerializers::SerializableResource.new(
-      follow,
-      serializer: ActivityPub::RejectFollowSerializer,
-      adapter: ActivityPub::Adapter
-    ).to_json
-
-    ActivityPub::DeliveryWorker.perform_async(json, current_account.id, follow.account.inbox_url)
+    ActivityPub::DeliveryWorker.perform_async(Oj.dump(serialize_payload(follow, ActivityPub::RejectFollowSerializer)), current_account.id, follow.account.inbox_url)
   end
 
   def approve!