diff --git a/app/workers/question_worker.rb b/app/workers/question_worker.rb index 9a361553..9e7a3e2b 100644 --- a/app/workers/question_worker.rb +++ b/app/workers/question_worker.rb @@ -15,6 +15,7 @@ class QuestionWorker next if f.inbox_locked? next if f.banned? next if MuteRule.where(user: f).any? { |rule| rule.applies_to? question } + next if user.muting?(question.user) Inbox.create(user_id: f.id, question_id: question_id, new: true) end diff --git a/lib/use_case/question/create.rb b/lib/use_case/question/create.rb index 15ebcf5e..36ef0205 100644 --- a/lib/use_case/question/create.rb +++ b/lib/use_case/question/create.rb @@ -80,7 +80,8 @@ 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, nil], user_id: [target_user.id, nil]).any?) || + (source_user_id && target_user.muting?(source_user)) end def source_user