|
|
@ -100,9 +100,14 @@ class ProcessFeedService < BaseService |
|
|
|
|
|
|
|
|
|
|
|
next unless media.nil? |
|
|
|
next unless media.nil? |
|
|
|
|
|
|
|
|
|
|
|
media = MediaAttachment.new(account: status.account, status: status, remote_url: enclosure_link.attribute('href').value) |
|
|
|
begin |
|
|
|
media.file_remote_url = enclosure_link.attribute('href').value |
|
|
|
media = MediaAttachment.new(account: status.account, status: status, remote_url: enclosure_link.attribute('href').value) |
|
|
|
media.save |
|
|
|
media.file_remote_url = enclosure_link.attribute('href').value |
|
|
|
|
|
|
|
media.save |
|
|
|
|
|
|
|
rescue Paperclip::Errors::NotIdentifiedByImageMagickError |
|
|
|
|
|
|
|
Rails.logger.debug "Error saving attachment from #{enclosure_link.attribute('href').value}" |
|
|
|
|
|
|
|
next |
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
@ -213,7 +218,7 @@ class ProcessFeedService < BaseService |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def target_url(xml) |
|
|
|
def target_url(xml) |
|
|
|
xml.at_xpath('.//activity:object').at_xpath('./xmlns:link[@rel="alternate"]', activity: ACTIVITY_NS).attribute('href').value |
|
|
|
xml.at_xpath('.//activity:object', activity: ACTIVITY_NS).at_xpath('./xmlns:link[@rel="alternate"]').attribute('href').value |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def object_type(xml) |
|
|
|
def object_type(xml) |
|
|
|