From aff182ce63e076dbf8b5dfe38c4e41cbd7ee1388 Mon Sep 17 00:00:00 2001 From: KMY Date: Tue, 9 May 2023 18:42:07 +0900 Subject: [PATCH] Remove status in antenna list or home --- app/services/remove_status_service.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/services/remove_status_service.rb b/app/services/remove_status_service.rb index a10a137dc3..d7b0e57b2f 100644 --- a/app/services/remove_status_service.rb +++ b/app/services/remove_status_service.rb @@ -26,6 +26,7 @@ class RemoveStatusService < BaseService remove_from_self if @account.local? remove_from_followers remove_from_lists + remove_from_antennas # There is no reason to send out Undo activities when the # cause is that the original object has been removed, since @@ -68,6 +69,15 @@ class RemoveStatusService < BaseService end end + def remove_from_antennas + Antenna.availables.where.not(list_id: 0).select(:id, :list_id, :account_id).includes(account: :user).reorder(nil).find_each do |antenna| + FeedManager.instance.unpush_from_list(antenna.list, @status) if antenna.list.present? + end + Antenna.availables.where(list_id: 0).select(:id, :account_id).includes(account: :user).reorder(nil).find_each do |antenna| + FeedManager.instance.unpush_from_home(antenna.account, @status) + end + end + def remove_from_mentions # For limited visibility statuses, the mentions that determine # who receives them in their home feed are a subset of followers