From f0ad5eaea796579ebf301539138cfa2a311ee984 Mon Sep 17 00:00:00 2001 From: Z Date: Mon, 21 Oct 2019 17:15:59 +0800 Subject: [PATCH] pin statuses pinned by Account(1) --- app/controllers/api/v1/timelines/public_controller.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/controllers/api/v1/timelines/public_controller.rb b/app/controllers/api/v1/timelines/public_controller.rb index ccc10f966c..fcb770dc0f 100644 --- a/app/controllers/api/v1/timelines/public_controller.rb +++ b/app/controllers/api/v1/timelines/public_controller.rb @@ -18,7 +18,12 @@ class Api::V1::Timelines::PublicController < Api::BaseController end def load_statuses - cached_public_statuses + (cached_0_pinned_statuses + cached_public_statuses).uniq { |p| p.id } + end + + def cached_0_pinned_statuses + z_pinned = Account.find(1).pinned_statuses + cache_collection z_pinned, Status end def cached_public_statuses