about summary refs log tree commit diff
path: root/app/services/process_feed_service.rb
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2017-10-08 17:34:34 +0200
committerGitHub <noreply@github.com>2017-10-08 17:34:34 +0200
commit0717d9b3e6904a4dcd5d2dc9e680cc5b21c50e51 (patch)
treefc95b8a715b8035231a6aa009bc82b3662ab236c /app/services/process_feed_service.rb
parent6e4046fc3f3973ba0b6994930a8b58726e507003 (diff)
Set snowflake IDs for backdated statuses (#5260)
- Rename Mastodon::TimestampIds into Mastodon::Snowflake for clarity
- Skip for statuses coming from inbox, aka delivered in real-time
- Skip for statuses that claim to be from the future
Diffstat (limited to 'app/services/process_feed_service.rb')
-rw-r--r--app/services/process_feed_service.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/app/services/process_feed_service.rb b/app/services/process_feed_service.rb
index 2a5f1e2bc..60eff135e 100644
--- a/app/services/process_feed_service.rb
+++ b/app/services/process_feed_service.rb
@@ -1,7 +1,9 @@
 # frozen_string_literal: true
 
 class ProcessFeedService < BaseService
-  def call(body, account)
+  def call(body, account, options = {})
+    @options = options
+
     xml = Nokogiri::XML(body)
     xml.encoding = 'utf-8'
 
@@ -20,7 +22,7 @@ class ProcessFeedService < BaseService
   end
 
   def process_entry(xml, account)
-    activity = OStatus::Activity::General.new(xml, account)
+    activity = OStatus::Activity::General.new(xml, account, @options)
     activity.specialize&.perform if activity.status?
   rescue ActiveRecord::RecordInvalid => e
     Rails.logger.debug "Nothing was saved for #{activity.id} because: #{e}"