Prevent global anon blocks blocking every anon question with a user

This commit is contained in:
Andreas Nedbal 2023-01-11 01:47:32 +01:00
parent 04f53f356d
commit 00e677886f
1 changed files with 1 additions and 1 deletions

View File

@ -94,7 +94,7 @@ module UseCase
def filtered?(question)
target_user.mute_rules.any? { |rule| rule.applies_to? question } ||
(anonymous && AnonymousBlock.where(identifier: question.author_identifier, user_id: [target_user.id, nil]).any?) ||
(source_user_id && anonymous && AnonymousBlock.where(target_user_id: [source_user.id, nil], user_id: [target_user.id, nil]).any?) ||
(source_user_id && anonymous && AnonymousBlock.where(target_user_id: source_user.id, user_id: [target_user.id, nil]).any?) ||
(source_user_id && target_user.muting?(source_user))
end