From 5843958caf4e50b29549cfc3b0db672036f74316 Mon Sep 17 00:00:00 2001 From: Z Date: Wed, 2 Feb 2022 20:45:41 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B1=95=E7=A4=BA=E8=BD=AC=E5=98=9F=EF=BC=8C?= =?UTF-8?q?=E6=9B=BF=E4=BB=A3=201d0ddd33b6=20=E7=9A=84=E4=B8=B4=E6=97=B6?= =?UTF-8?q?=E6=8E=AA=E6=96=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/api/v1/timelines/public_controller.rb | 3 ++- app/models/status.rb | 5 +---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/app/controllers/api/v1/timelines/public_controller.rb b/app/controllers/api/v1/timelines/public_controller.rb index d253b744f..31334089a 100644 --- a/app/controllers/api/v1/timelines/public_controller.rb +++ b/app/controllers/api/v1/timelines/public_controller.rb @@ -37,7 +37,8 @@ class Api::V1::Timelines::PublicController < Api::BaseController current_account, local: truthy_param?(:local), remote: truthy_param?(:remote), - only_media: truthy_param?(:only_media) + only_media: truthy_param?(:only_media), + with_reblogs: true ) end diff --git a/app/models/status.rb b/app/models/status.rb index 2208526c8..0cda8ad0a 100644 --- a/app/models/status.rb +++ b/app/models/status.rb @@ -88,10 +88,7 @@ class Status < ApplicationRecord scope :with_accounts, ->(ids) { where(id: ids).includes(:account) } #scope :without_replies, -> { where('statuses.reply = FALSE OR statuses.in_reply_to_account_id = statuses.account_id') } scope :without_replies, -> { where('statuses.reply = FALSE') } - #scope :without_reblogs, -> { where('statuses.reblog_of_id IS NULL') } - scope :without_reblogs, -> { where('statuses.account_id != 830') } - #scope :without_reblogs, -> { joins('INNER JOIN statuses ori ON (statuses.reblog_of_id is NULL AND ori.id = statuses.id) OR ori.id = statuses.reblog_of_id') - # .where('ori.account_id = statuses.account_id') } + scope :without_reblogs, -> { where('statuses.reblog_of_id IS NULL') } scope :with_public_visibility, -> { where(visibility: :public) } scope :tagged_with, ->(tag_ids) { joins(:statuses_tags).where(statuses_tags: { tag_id: tag_ids }) } scope :in_chosen_languages, ->(account) { where(language: nil).or where(language: account.chosen_languages) }