diff --git a/app/lib/activitypub/activity/create.rb b/app/lib/activitypub/activity/create.rb index 85a66c6852..65689998c8 100644 --- a/app/lib/activitypub/activity/create.rb +++ b/app/lib/activitypub/activity/create.rb @@ -89,8 +89,8 @@ class ActivityPub::Activity::Create < ActivityPub::Activity text: converted_object_type? ? converted_text : (@status_parser.text || ''), language: @status_parser.language, spoiler_text: converted_object_type? ? '' : (@status_parser.spoiler_text || ''), - created_at: @status_parser.created_at, - edited_at: @status_parser.edited_at && @status_parser.edited_at != @status_parser.created_at ? @status_parser.edited_at : nil, + created_at: [Time.now.utc, @status_parser.created_at].compact.min, + edited_at: @status_parser.edited_at && @status_parser.edited_at != @status_parser.created_at ? [Time.now.utc, @status_parser.edited_at].compact.min : nil, override_timestamps: @options[:override_timestamps], reply: @status_parser.reply, sensitive: @account.sensitized? || @status_parser.sensitive || false, diff --git a/app/models/trends/statuses.rb b/app/models/trends/statuses.rb index 8757e5aa9c..70db65b6b2 100644 --- a/app/models/trends/statuses.rb +++ b/app/models/trends/statuses.rb @@ -123,7 +123,7 @@ class Trends::Statuses < Trends::Base decaying_score = if score.zero? || !eligible?(status) 0 else - score * (0.5**((at_time.to_f - status.created_at.to_f) / options[:score_halflife].to_f)) + score * (0.5**((at_time.to_f - [at_time.to_f, status.created_at.to_f].min) / options[:score_halflife].to_f)) end [decaying_score, status]