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
This commit is contained in:
parent
6e4046fc3f
commit
0717d9b3e6
16 changed files with 83 additions and 43 deletions
|
@ -1,9 +1,10 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class OStatus::Activity::Base
|
||||
def initialize(xml, account = nil)
|
||||
@xml = xml
|
||||
def initialize(xml, account = nil, options = {})
|
||||
@xml = xml
|
||||
@account = account
|
||||
@options = options
|
||||
end
|
||||
|
||||
def status?
|
||||
|
|
|
@ -34,7 +34,7 @@ class OStatus::Activity::Creation < OStatus::Activity::Base
|
|||
reblog: cached_reblog,
|
||||
text: content,
|
||||
spoiler_text: content_warning,
|
||||
created_at: published,
|
||||
created_at: @options[:override_timestamps] ? nil : published,
|
||||
reply: thread?,
|
||||
language: content_language,
|
||||
visibility: visibility_scope,
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
class OStatus::Activity::General < OStatus::Activity::Base
|
||||
def specialize
|
||||
special_class&.new(@xml, @account)
|
||||
special_class&.new(@xml, @account, @options)
|
||||
end
|
||||
|
||||
private
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue