about summary refs log tree commit diff
path: root/app/services/process_feed_service.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/services/process_feed_service.rb')
-rw-r--r--app/services/process_feed_service.rb16
1 files changed, 3 insertions, 13 deletions
diff --git a/app/services/process_feed_service.rb b/app/services/process_feed_service.rb
index 7a27b7b29..4d23a6262 100644
--- a/app/services/process_feed_service.rb
+++ b/app/services/process_feed_service.rb
@@ -20,6 +20,8 @@ class ProcessFeedService < BaseService
   end
 
   class ProcessEntry
+    include AuthorExtractor
+
     def call(xml, account)
       @account = account
       @xml     = xml
@@ -108,7 +110,7 @@ class ProcessFeedService < BaseService
       # If that author cannot be found, don't record the status (do not misattribute)
       if account?(entry)
         begin
-          account = find_or_resolve_account(acct(entry))
+          account = author_from_xml(entry)
           return [nil, false] if account.nil?
         rescue Goldfinger::Error
           return [nil, false]
@@ -143,10 +145,6 @@ class ProcessFeedService < BaseService
       [status, true]
     end
 
-    def find_or_resolve_account(acct)
-      FollowRemoteAccountService.new.call(acct)
-    end
-
     def find_or_resolve_status(parent, uri, url)
       status = find_status(uri)
 
@@ -275,13 +273,5 @@ class ProcessFeedService < BaseService
     def account?(xml = @xml)
       !xml.at_xpath('./xmlns:author', xmlns: TagManager::XMLNS).nil?
     end
-
-    def acct(xml = @xml)
-      username = xml.at_xpath('./xmlns:author/xmlns:name', xmlns: TagManager::XMLNS).content
-      url      = xml.at_xpath('./xmlns:author/xmlns:uri', xmlns: TagManager::XMLNS).content
-      domain   = Addressable::URI.parse(url).normalize.host
-
-      "#{username}@#{domain}"
-    end
   end
 end