about summary refs log tree commit diff
path: root/app/services/follow_service.rb
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2017-09-10 09:58:38 +0200
committerGitHub <noreply@github.com>2017-09-10 09:58:38 +0200
commit7d7844a47fdfb8862847f025dc4c1b1bc5fdafe5 (patch)
treef15741c04d74eb2999a8c36ea758cc20da17830f /app/services/follow_service.rb
parentf2cbfb2eb375cde302461a91e5fb0a3af8f6eeb5 (diff)
Default follows for new users (#4871)
When a new user confirms their e-mail, bootstrap their home timeline
by automatically following a set of accounts. By default, all local
admin accounts (that are unlocked). Can be customized by new admin
setting (comma-separated usernames, local and unlocked only)
Diffstat (limited to 'app/services/follow_service.rb')
-rw-r--r--app/services/follow_service.rb4
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)