mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: Add new don't feed the trolls feature (#21001)
Responding to negative behaviour tends to solicit more of the same. Common wisdom states: "don't feed the trolls". This change codifies that advice by introducing a new nudge when hitting the reply button on a flagged post. It will be shown if either the current user, or two other users (configurable via a site setting) have flagged the post.
This commit is contained in:
@@ -550,10 +550,14 @@ class Post < ActiveRecord::Base
|
||||
end
|
||||
|
||||
def is_flagged?
|
||||
flags.count != 0
|
||||
end
|
||||
|
||||
def flags
|
||||
post_actions.where(
|
||||
post_action_type_id: PostActionType.flag_types_without_custom.values,
|
||||
deleted_at: nil,
|
||||
).count != 0
|
||||
)
|
||||
end
|
||||
|
||||
def reviewable_flag
|
||||
|
||||
Reference in New Issue
Block a user