diff options
Diffstat (limited to 'app/services/batched_remove_status_service.rb')
-rw-r--r-- | app/services/batched_remove_status_service.rb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/app/services/batched_remove_status_service.rb b/app/services/batched_remove_status_service.rb index 7e9b67126..a48386ba2 100644 --- a/app/services/batched_remove_status_service.rb +++ b/app/services/batched_remove_status_service.rb @@ -19,7 +19,10 @@ class BatchedRemoveStatusService < BaseService ActiveRecord::Associations::Preloader.new.preload(statuses_with_account_conversations, [mentions: :account]) - statuses_with_account_conversations.each(&:unlink_from_conversations!) + statuses_with_account_conversations.each do |status| + status.unlink_from_conversations! + unpush_from_direct_timelines(status) + end # We do not batch all deletes into one to avoid having a long-running # transaction lock the database, but we use the delete method instead @@ -88,4 +91,10 @@ class BatchedRemoveStatusService < BaseService pipeline.publish("timeline:hashtag:#{hashtag}:local", payload) if status.local? end end + + def unpush_from_direct_timelines(status) + status.mentions.each do |mention| + FeedManager.instance.unpush_from_direct(mention.account, status) if mention.account.local? + end + end end |