]> cat aescling's git repositories - mastodon.git/commitdiff
Fix duplication of media attachments when a remote status reblogs a local one
authorEugen Rochko <eugen@zeonfederated.com>
Fri, 14 Oct 2016 18:14:53 +0000 (20:14 +0200)
committerEugen Rochko <eugen@zeonfederated.com>
Fri, 14 Oct 2016 18:15:37 +0000 (20:15 +0200)
app/services/process_feed_service.rb

index 1efa0e15a15cfcb70f7c2dc24828a0e92bf0a6a1..2f53b9c77c6b083fde1187faa2f9b1571b7bdd1f 100644 (file)
@@ -56,6 +56,8 @@ class ProcessFeedService < BaseService
   end
 
   def record_remote_mentions(status, links)
+    return if status.local?
+
     # Here we have to do a reverse lookup of local accounts by their URL!
     # It's not pretty at all! I really wish all these protocols sticked to
     # using acct:username@domain only! It would make things so much easier
@@ -93,6 +95,8 @@ class ProcessFeedService < BaseService
   end
 
   def process_attachments(entry, status)
+    return if status.local?
+
     entry.xpath('./xmlns:link[@rel="enclosure"]').each do |enclosure_link|
       next if enclosure_link.attribute('href').nil?