Remove special cases for flagging

Prior to the new review queue there were a couple special cases where
posts would be auto hidden:

* If a TL3 or above flagged a TL0 post as spam
* If a TL4 or above flagged a non-staff, non-TL4 post as spam, inappropriate or off
topic.

These cases are now removed in favour of the scoring system.
This commit is contained in:
Robin Ward
2019-09-17 13:37:22 -04:00
parent 5c897b6d0c
commit 4cd620e36e
2 changed files with 3 additions and 66 deletions

View File

@ -156,22 +156,9 @@ private
return if @post.hidden?
return if !@created_by.staff? && @post.user&.staff?
if @post_action_name == :spam &&
@created_by.has_trust_level?(TrustLevel[3]) &&
@post.user&.trust_level == TrustLevel[0]
@post.hide!(@post_action_type_id, Post.hidden_reasons[:flagged_by_tl3_user])
elsif PostActionType.auto_action_flag_types.include?(@post_action_name)
if @created_by.has_trust_level?(TrustLevel[4]) &&
!@created_by.staff? &&
@post.user&.trust_level != TrustLevel[4]
@post.hide!(@post_action_type_id, Post.hidden_reasons[:flagged_by_tl4_user])
else
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