diff options
author | ThibG <thib@sitedethib.com> | 2019-07-21 00:53:28 +0200 |
---|---|---|
committer | Holly 'Frinkel' Lotor <admin@frinkel.tech> | 2020-01-20 16:55:55 -0500 |
commit | b0630ddc8261250c5edbf2907648695041649e98 (patch) | |
tree | 9ca374e4e98598efced200e4a993875245ab93b6 /app/services/batched_remove_status_service.rb | |
parent | 9447566b8ed8e532c13dd97ecd53681029fdcec0 (diff) |
Original upstream merge
Diffstat (limited to 'app/services/batched_remove_status_service.rb')
-rw-r--r-- | app/services/batched_remove_status_service.rb | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/app/services/batched_remove_status_service.rb b/app/services/batched_remove_status_service.rb index 3110cb511..09d094c15 100644 --- a/app/services/batched_remove_status_service.rb +++ b/app/services/batched_remove_status_service.rb @@ -10,12 +10,12 @@ class BatchedRemoveStatusService < BaseService # @param [Hash] options # @option [Boolean] :skip_side_effects def call(statuses, **options) - statuses = Status.where(id: statuses.map(&:id)).includes(:account, :stream_entry).flat_map { |status| [status] + status.reblogs.includes(:account, :stream_entry).to_a } + statuses = Status.where(id: statuses.map(&:id)).includes(:account).flat_map { |status| [status] + status.reblogs.includes(:account).to_a } @mentions = statuses.each_with_object({}) { |s, h| h[s.id] = s.active_mentions.includes(:account).to_a } @tags = statuses.each_with_object({}) { |s, h| h[s.id] = s.tags.pluck(:name) } - @json_payloads = statuses.each_with_object({}) { |s, h| h[s.id] = Oj.dump(event: :delete, payload: s.id.to_s) } + @json_payloads = statuses.each_with_object({}) { |s, h| h[s.id] = Oj.dump(event: :delete, payload: s.id.to_s) } # Ensure that rendered XML reflects destroyed state statuses.each do |status| @@ -89,9 +89,12 @@ class BatchedRemoveStatusService < BaseService payload = @json_payloads[status.id] redis.pipelined do @mentions[status.id].each do |mention| - redis.publish("timeline:direct:#{mention.account.id}", payload) if mention.account.local? +# TODO: Pull https://github.com/ThibG/mastodon/commit/ca17bae904783dfb1f4899a533d28a79da0c6fe9 + redis.publish("timeline:direct:#{mention.account.id}", payload) if mention.account.local? +# FeedManager.instance.unpush_from_direct(mention.account, status) if mention.account.local? end redis.publish("timeline:direct:#{status.account.id}", payload) if status.account.local? +# FeedManager.instance.unpush_from_direct(status.account, status) if status.account.local? end end end |