diff --git a/app/models/status.rb b/app/models/status.rb index 7e3dbe8e..a36980e8 100644 --- a/app/models/status.rb +++ b/app/models/status.rb @@ -302,13 +302,13 @@ class Status < ApplicationRecord end def as_home_timeline(account) - query = where('updated_at > ?', 5.days.ago) + query = where('created_at > ?', 5.days.ago) query.where(visibility: [:public, :unlisted, :private]) query.where(account: [account] + account.following).without_replies end def as_group_timeline(group) - query = where('updated_at > ?', 5.days.ago) + query = where('created_at > ?', 5.days.ago) query.where(group: group).without_replies end diff --git a/app/services/post_status_service.rb b/app/services/post_status_service.rb index 0f150bc6..1af33e7f 100644 --- a/app/services/post_status_service.rb +++ b/app/services/post_status_service.rb @@ -120,6 +120,7 @@ class PostStatusService < BaseService raise GabSocial::ValidationError, I18n.t('media_attachments.validations.too_many') if @options[:media_ids].size > 4 || @options[:poll].present? + @account.media_attachments.connection.stick_to_master! @media = @account.media_attachments.where(status_id: nil).where(id: @options[:media_ids].take(4).map(&:to_i)) hasVideoOrGif = @media.find(&:video?) || @media.find(&:gifv?)