diff options
author | David Yip <yipdw@member.fsf.org> | 2017-09-10 13:04:27 -0500 |
---|---|---|
committer | David Yip <yipdw@member.fsf.org> | 2017-09-10 13:04:27 -0500 |
commit | 932571fa22273e6ff5c229147668c426b4d65326 (patch) | |
tree | 973b16e23a7cbeaf5a43550444e54aa1ace50a46 /app/services/follow_service.rb | |
parent | c9df53044a333276853f7dc7ef2aed6d48df087f (diff) | |
parent | ab71cf4593ed3259168c641d5f4f5a0ebbe4d045 (diff) |
Merge tag 'v1.6.0' into sync/upstream
Diffstat (limited to 'app/services/follow_service.rb')
-rw-r--r-- | app/services/follow_service.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/services/follow_service.rb b/app/services/follow_service.rb index 941556b60..791773f25 100644 --- a/app/services/follow_service.rb +++ b/app/services/follow_service.rb @@ -5,9 +5,9 @@ class FollowService < BaseService # Follow a remote user, notify remote user about the follow # @param [Account] source_account From which to follow - # @param [String] uri User URI to follow in the form of username@domain + # @param [String, Account] uri User URI to follow in the form of username@domain (or account record) def call(source_account, uri) - target_account = ResolveRemoteAccountService.new.call(uri) + target_account = uri.is_a?(Account) ? uri : ResolveRemoteAccountService.new.call(uri) 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) |