From 952f51659baf03b85f4fcc04a2e9434777bbdb4f Mon Sep 17 00:00:00 2001 From: KMY Date: Mon, 2 Oct 2023 17:25:49 +0900 Subject: [PATCH] =?UTF-8?q?Fix:=20=E3=83=96=E3=83=BC=E3=82=B9=E3=83=88?= =?UTF-8?q?=E3=81=95=E3=82=8C=E3=81=9F=E3=81=B0=E3=81=8B=E3=82=8A=E3=81=AE?= =?UTF-8?q?=E6=8A=95=E7=A8=BF=E3=82=92=E7=B7=A8=E9=9B=86=E3=81=97=E3=81=A6?= =?UTF-8?q?=E3=82=82=E7=9B=B8=E6=89=8B=E3=81=AE=E3=82=BF=E3=82=A4=E3=83=A0?= =?UTF-8?q?=E3=83=A9=E3=82=A4=E3=83=B3=E3=81=AB=E5=8F=8D=E6=98=A0=E3=81=95?= =?UTF-8?q?=E3=82=8C=E3=81=AA=E3=81=84=E5=95=8F=E9=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/lib/feed_manager.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/lib/feed_manager.rb b/app/lib/feed_manager.rb index 7d530906c6..924884d39d 100644 --- a/app/lib/feed_manager.rb +++ b/app/lib/feed_manager.rb @@ -58,7 +58,7 @@ class FeedManager # @param [Boolean] update # @return [Boolean] def push_to_home(account, status, update: false) - return false unless add_to_feed(:home, account.id, status, aggregate_reblogs: account.user&.aggregates_reblogs?) + return false unless add_to_feed(:home, account.id, status, aggregate_reblogs: account.user&.aggregates_reblogs?, update: update) trim(:home, account.id) PushUpdateWorker.perform_async(account.id, status.id, "timeline:#{account.id}", { 'update' => update }) if push_update_required?("timeline:#{account.id}") @@ -83,7 +83,7 @@ class FeedManager # @param [Boolean] update # @return [Boolean] def push_to_list(list, status, update: false) - return false if filter_from_list?(status, list) || !add_to_feed(:list, list.id, status, aggregate_reblogs: list.account.user&.aggregates_reblogs?) + return false if filter_from_list?(status, list) || !add_to_feed(:list, list.id, status, aggregate_reblogs: list.account.user&.aggregates_reblogs?, update: update) trim(:list, list.id) PushUpdateWorker.perform_async(list.account_id, status.id, "timeline:list:#{list.id}", { 'update' => update }) if push_update_required?("timeline:list:#{list.id}") @@ -91,7 +91,7 @@ class FeedManager end def push_to_antenna(antenna, status, update: false) - return false unless add_to_feed(:antenna, antenna.id, status, aggregate_reblogs: antenna.account.user&.aggregates_reblogs?) + return false unless add_to_feed(:antenna, antenna.id, status, aggregate_reblogs: antenna.account.user&.aggregates_reblogs?, update: update) trim(:antenna, antenna.id) PushUpdateWorker.perform_async(antenna.account_id, status.id, "timeline:antenna:#{antenna.id}", { 'update' => update }) if push_update_required?("timeline:antenna:#{antenna.id}") @@ -497,7 +497,9 @@ class FeedManager # @param [Status] status # @param [Boolean] aggregate_reblogs # @return [Boolean] - def add_to_feed(timeline_type, account_id, status, aggregate_reblogs: true) + def add_to_feed(timeline_type, account_id, status, aggregate_reblogs: true, update: false) + return true if update + timeline_key = key(timeline_type, account_id) reblog_key = key(timeline_type, account_id, 'reblogs')