Merge remote-tracking branch 'parent/main' into upstream-20231111

This commit is contained in:
KMY 2023-11-11 08:25:43 +09:00
commit 55c6192f15
60 changed files with 326 additions and 382 deletions

View file

@ -590,7 +590,7 @@ class FeedManager
def build_crutches(receiver_id, statuses)
crutches = {}
crutches[:active_mentions] = Mention.active.where(status_id: statuses.flat_map { |s| [s.id, s.reblog_of_id] }.compact).pluck(:status_id, :account_id).each_with_object({}) { |(id, account_id), mapping| (mapping[id] ||= []).push(account_id) }
crutches[:active_mentions] = crutches_active_mentions(statuses)
check_for_blocks = statuses.flat_map do |s|
arr = crutches[:active_mentions][s.id] || []
@ -619,4 +619,12 @@ class FeedManager
crutches
end
def crutches_active_mentions(statuses)
Mention
.active
.where(status_id: statuses.flat_map { |status| [status.id, status.reblog_of_id] }.compact)
.pluck(:status_id, :account_id)
.each_with_object({}) { |(id, account_id), mapping| (mapping[id] ||= []).push(account_id) }
end
end