Merge commit 'c1f398ae93' into kb-draft-15.9-lts

This commit is contained in:
KMY 2025-02-28 09:14:02 +09:00
commit 3eead356e7
207 changed files with 6055 additions and 3148 deletions

View file

@ -28,7 +28,7 @@ class FeedInsertWorker
check_and_insert
end
perform_notify_for_list if !feed_filtered? && notify_for_list?
perform_notify_for_list if !feed_filter && notify_for_list?
rescue ActiveRecord::RecordNotFound
true
end
@ -36,27 +36,31 @@ class FeedInsertWorker
private
def check_and_insert
if feed_filtered?
filter_result = feed_filter
if filter_result
perform_unpush if update?
else
perform_push
perform_notify if notify?
end
perform_notify if notify?(filter_result)
end
def feed_filtered?
def feed_filter
case @type
when :home, :antenna
FeedManager.instance.filter?(:home, @status, @follower)
FeedManager.instance.filter(:home, @status, @follower)
when :tags
FeedManager.instance.filter?(:tags, @status, @follower)
FeedManager.instance.filter(:tags, @status, @follower)
when :list
FeedManager.instance.filter?(:list, @status, @list, stl_home: stl_home?)
FeedManager.instance.filter(:list, @status, @list, stl_home: stl_home?)
end
end
def notify?
return false if @type != :home || @status.reblog? || (@status.reply? && @status.in_reply_to_account_id != @status.account_id)
def notify?(filter_result)
return false if @type != :home || @status.reblog? || (@status.reply? && @status.in_reply_to_account_id != @status.account_id) ||
filter_result == :filter
Follow.find_by(account: @follower, target_account: @status.account)&.notify?
end