mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Sensitivity did not work by default
Forums without previously calculated scores would return the same values for low/medium/high sensitivity. Now those are scaled based on the default value. The default value has also been changed from 10.0 to 12.5 based on observing data from live discourse forums.
This commit is contained in:
@@ -155,6 +155,7 @@ private
|
||||
def auto_hide_if_needed
|
||||
return if @post.hidden?
|
||||
return if !@created_by.staff? && @post.user&.staff?
|
||||
return unless PostActionType.auto_action_flag_types.include?(@post_action_name)
|
||||
|
||||
# Special case: If you have TL3 and the user is TL0, and the flag is spam,
|
||||
# hide it immediately.
|
||||
@@ -163,11 +164,11 @@ private
|
||||
@post.user&.trust_level == TrustLevel[0]
|
||||
@post.hide!(@post_action_type_id, Post.hidden_reasons[:flagged_by_tl3_user])
|
||||
return
|
||||
elsif PostActionType.auto_action_flag_types.include?(@post_action_name)
|
||||
score = ReviewableFlaggedPost.find_by(target: @post)&.score || 0
|
||||
if score >= Reviewable.score_required_to_hide_post
|
||||
@post.hide!(@post_action_type_id)
|
||||
end
|
||||
end
|
||||
|
||||
score = ReviewableFlaggedPost.find_by(target: @post)&.score || 0
|
||||
if score >= Reviewable.score_required_to_hide_post
|
||||
@post.hide!(@post_action_type_id)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user