about summary refs log tree commit diff
path: root/app/services/follow_service.rb
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2021-03-02 16:33:06 +0100
committerGitHub <noreply@github.com>2021-03-02 16:33:06 +0100
commitf4abf8e7829c6a5b952dea6fb9ad01b6b3601f95 (patch)
treeafc41f393d862885eae63cccd3b72262ce08128b /app/services/follow_service.rb
parent4aa860b65bd796b09dc0ceffa1fdd7de31060a34 (diff)
parent7336276252ab89985c609359eb9953fca0383db3 (diff)
Merge pull request #1504 from ClearlyClaire/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'app/services/follow_service.rb')
-rw-r--r--app/services/follow_service.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/app/services/follow_service.rb b/app/services/follow_service.rb
index b98f7011d..d3db07a74 100644
--- a/app/services/follow_service.rb
+++ b/app/services/follow_service.rb
@@ -3,10 +3,11 @@
 class FollowService < BaseService
   include Redisable
   include Payloadable
+  include DomainControlHelper
 
   # 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)
+  # @param [Account] target_account Account to follow
   # @param [Hash] options
   # @option [Boolean] :reblogs Whether or not to show reblogs, defaults to true
   # @option [Boolean] :notify Whether to create notifications about new posts, defaults to false
@@ -15,7 +16,7 @@ class FollowService < BaseService
   # @option [Boolean] :with_rate_limit
   def call(source_account, target_account, options = {})
     @source_account = source_account
-    @target_account = ResolveAccountService.new.call(target_account, skip_webfinger: true)
+    @target_account = target_account
     @options        = { bypass_locked: false, bypass_limit: false, with_rate_limit: false }.merge(options)
 
     raise ActiveRecord::RecordNotFound if following_not_possible?
@@ -43,7 +44,7 @@ class FollowService < BaseService
   end
 
   def following_not_allowed?
-    @target_account.blocking?(@source_account) || @source_account.blocking?(@target_account) || @target_account.moved? || (!@target_account.local? && @target_account.ostatus?) || @source_account.domain_blocking?(@target_account.domain)
+    domain_not_allowed?(@target_account.domain) || @target_account.blocking?(@source_account) || @source_account.blocking?(@target_account) || @target_account.moved? || (!@target_account.local? && @target_account.ostatus?) || @source_account.domain_blocking?(@target_account.domain)
   end
 
   def change_follow_options!