about summary refs log tree commit diff
path: root/app/services/follow_remote_account_service.rb
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-03-21 18:26:47 +0100
committerEugen Rochko <eugen@zeonfederated.com>2016-03-21 18:26:47 +0100
commitf14f462eaf8dcf272db54cd513bf7ffe7dc6a6e3 (patch)
tree2275619996f64b55369e4f35cd228eb52dc48601 /app/services/follow_remote_account_service.rb
parentc28971c70c3d5caf18a5e931ff345534f1e4cece (diff)
Adding Turbolinks, adding status posting form on homepage
Diffstat (limited to 'app/services/follow_remote_account_service.rb')
-rw-r--r--app/services/follow_remote_account_service.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/app/services/follow_remote_account_service.rb b/app/services/follow_remote_account_service.rb
index 2f842e329..01e07e2e9 100644
--- a/app/services/follow_remote_account_service.rb
+++ b/app/services/follow_remote_account_service.rb
@@ -7,7 +7,10 @@ class FollowRemoteAccountService < BaseService
   # @return [Account]
   def call(uri, subscribe = true)
     username, domain = uri.split('@')
-    account = Account.where(username: username, domain: domain).first
+
+    return Account.find_local(username) if domain == Rails.configuration.x.local_domain
+
+    account = Account.find_by(username: username, domain: domain)
 
     if account.nil?
       account = Account.new(username: username, domain: domain)