Remove status in antenna list or home

This commit is contained in:
KMY 2023-05-09 18:42:07 +09:00
parent 2a1a2da06a
commit aff182ce63

View file

@ -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