Track question users in anonymous blocks
This commit is contained in:
parent
e7f60acad5
commit
97736a956d
|
@ -12,7 +12,8 @@ class AnonymousBlockController < ApplicationController
|
||||||
AnonymousBlock.create!(
|
AnonymousBlock.create!(
|
||||||
user: params[:global] ? nil : current_user,
|
user: params[:global] ? nil : current_user,
|
||||||
identifier: question.author_identifier,
|
identifier: question.author_identifier,
|
||||||
question:
|
question:,
|
||||||
|
target_user: question.user
|
||||||
)
|
)
|
||||||
|
|
||||||
inbox_id = question.inboxes.first.id
|
inbox_id = question.inboxes.first.id
|
||||||
|
|
|
@ -82,7 +82,8 @@ module UseCase
|
||||||
|
|
||||||
def filtered?(question)
|
def filtered?(question)
|
||||||
target_user.mute_rules.any? { |rule| rule.applies_to? 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
|
end
|
||||||
|
|
||||||
def source_user
|
def source_user
|
||||||
|
|
Loading…
Reference in New Issue