]> cat aescling's git repositories - mastodon.git/commitdiff
Use Account#find_remote method when possible
authorEugen Rochko <eugen@zeonfederated.com>
Mon, 10 Oct 2016 15:30:49 +0000 (17:30 +0200)
committerEugen Rochko <eugen@zeonfederated.com>
Mon, 10 Oct 2016 15:30:49 +0000 (17:30 +0200)
app/services/process_feed_service.rb

index 5b5800f16ec8c483396415e509fc08f480e589f7..537c1a8ffe94416d2941e135a7e4f31b6865b8e6 100644 (file)
@@ -147,7 +147,7 @@ class ProcessFeedService < BaseService
     username = xml.at_xpath('./activity:object/xmlns:author/xmlns:name').content
     url      = xml.at_xpath('./activity:object/xmlns:author/xmlns:uri').content
     domain   = Addressable::URI.parse(url).host
-    account  = Account.find_by(username: username, domain: domain)
+    account  = Account.find_remote(username, domain)
 
     if account.nil?
       account = follow_remote_account_service.call("#{username}@#{domain}")