about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/services/process_feed_service.rb15
1 files changed, 8 insertions, 7 deletions
diff --git a/app/services/process_feed_service.rb b/app/services/process_feed_service.rb
index 56105838e..924a78b65 100644
--- a/app/services/process_feed_service.rb
+++ b/app/services/process_feed_service.rb
@@ -51,6 +51,11 @@ class ProcessFeedService < BaseService
 
       Rails.logger.debug "Creating remote status #{id}"
 
+      if verb == :share
+        original_status = shared_status_from_xml(@xml.at_xpath('.//activity:object', activity: TagManager::AS_XMLNS))
+        return nil if original_status.nil?
+      end
+
       ApplicationRecord.transaction do
         status, just_created = status_from_xml(@xml)
 
@@ -58,14 +63,10 @@ class ProcessFeedService < BaseService
         return status unless just_created
 
         if verb == :share
-          original_status = shared_status_from_xml(@xml.at_xpath('.//activity:object', activity: TagManager::AS_XMLNS))
-          status.reblog   = original_status
-
-          if original_status.nil?
-            status.destroy
-            return nil
-          elsif original_status.reblog?
+          if original_status.reblog?
             status.reblog = original_status.reblog
+          else
+            status.reblog = original_status
           end
         end