about summary refs log tree commit diff
path: root/app/services/activitypub/prepare_followers_synchronization_service.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/services/activitypub/prepare_followers_synchronization_service.rb')
-rw-r--r--app/services/activitypub/prepare_followers_synchronization_service.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/app/services/activitypub/prepare_followers_synchronization_service.rb b/app/services/activitypub/prepare_followers_synchronization_service.rb
new file mode 100644
index 000000000..2d22ed701
--- /dev/null
+++ b/app/services/activitypub/prepare_followers_synchronization_service.rb
@@ -0,0 +1,13 @@
+# frozen_string_literal: true
+
+class ActivityPub::PrepareFollowersSynchronizationService < BaseService
+  include JsonLdHelper
+
+  def call(account, params)
+    @account = account
+
+    return if params['collectionId'] != @account.followers_url || invalid_origin?(params['url']) || @account.local_followers_hash == params['digest']
+
+    ActivityPub::FollowersSynchronizationWorker.perform_async(@account.id, params['url'])
+  end
+end