FIX: Put back the TL3 -> TL0 spam thing

We talked about it and decided it's still relevant in the score world.
This commit is contained in:
Robin Ward
2019-09-17 15:58:30 -04:00
parent 215f6d97e5
commit c3bbf643b1
2 changed files with 23 additions and 0 deletions

View File

@ -156,6 +156,15 @@ private
return if @post.hidden?
return if !@created_by.staff? && @post.user&.staff?
# Special case: If you have TL3 and the user is TL0, and the flag is spam,
# hide it immediately.
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])
return
end
score = ReviewableFlaggedPost.find_by(target: @post)&.score || 0
if score >= Reviewable.score_required_to_hide_post
@post.hide!(@post_action_type_id)