diff --git a/app/controllers/anonymous_block_controller.rb b/app/controllers/anonymous_block_controller.rb index 404d396e..1daf9d8c 100644 --- a/app/controllers/anonymous_block_controller.rb +++ b/app/controllers/anonymous_block_controller.rb @@ -12,7 +12,8 @@ class AnonymousBlockController < ApplicationController AnonymousBlock.create!( user: params[:global] ? nil : current_user, identifier: question.author_identifier, - question: + question:, + target_user: question.user ) inbox_id = question.inboxes.first.id diff --git a/lib/use_case/question/create.rb b/lib/use_case/question/create.rb index eb085350..5c9659fb 100644 --- a/lib/use_case/question/create.rb +++ b/lib/use_case/question/create.rb @@ -82,7 +82,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?) + (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?) end def source_user