From f14f462eaf8dcf272db54cd513bf7ffe7dc6a6e3 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Mon, 21 Mar 2016 18:26:47 +0100 Subject: Adding Turbolinks, adding status posting form on homepage --- app/services/follow_remote_account_service.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'app/services/follow_remote_account_service.rb') 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) -- cgit