about summary refs log tree commit diff
path: root/app/services/follow_service.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/services/follow_service.rb')
-rw-r--r--app/services/follow_service.rb8
1 files changed, 3 insertions, 5 deletions
diff --git a/app/services/follow_service.rb b/app/services/follow_service.rb
index 0020bc9fe..9d36a1449 100644
--- a/app/services/follow_service.rb
+++ b/app/services/follow_service.rb
@@ -1,8 +1,6 @@
 # frozen_string_literal: true
 
 class FollowService < BaseService
-  include StreamEntryRenderer
-
   # Follow a remote user, notify remote user about the follow
   # @param [Account] source_account From which to follow
   # @param [String, Account] uri User URI to follow in the form of username@domain (or account record)
@@ -12,7 +10,7 @@ class FollowService < BaseService
     target_account = ResolveAccountService.new.call(target_account, skip_webfinger: true)
 
     raise ActiveRecord::RecordNotFound if target_account.nil? || target_account.id == source_account.id || target_account.suspended?
-    raise Mastodon::NotPermittedError  if target_account.blocking?(source_account) || source_account.blocking?(target_account)
+    raise Mastodon::NotPermittedError  if target_account.blocking?(source_account) || source_account.blocking?(target_account) || target_account.moved?
 
     if source_account.following?(target_account)
       # We're already following this account, but we'll call follow! again to
@@ -82,10 +80,10 @@ class FollowService < BaseService
   end
 
   def build_json(follow_request)
-    Oj.dump(ActivityPub::LinkedDataSignature.new(ActiveModelSerializers::SerializableResource.new(
+    ActiveModelSerializers::SerializableResource.new(
       follow_request,
       serializer: ActivityPub::FollowSerializer,
       adapter: ActivityPub::Adapter
-    ).as_json).sign!(follow_request.account))
+    ).to_json
   end
 end