@ -9,7 +9,9 @@ class FetchRemoteAccountService < BaseService
private
def process_atom(url, body)
xml = Nokogiri::XML(body)
xml.encoding = 'utf-8'
url_parts = Addressable::URI.parse(url)
username = xml.at_xpath('//xmlns:author/xmlns:name').try(:content)
domain = url_parts.host
@ -11,7 +11,9 @@ class FetchRemoteStatusService < BaseService
Rails.logger.debug "Processing Atom for remote status at #{url}"
account = extract_author(url, xml)
return nil if account.nil?
@ -4,6 +4,7 @@ class ProcessFeedService < BaseService
def call(body, account)
update_author(xml, account)
process_entries(xml, account)
@ -6,7 +6,9 @@ class ProcessInteractionService < BaseService
# @param [Account] target_account Account the Salmon was addressed to
def call(envelope, target_account)
body = salmon.unpack(envelope)
return unless contains_author?(xml)