mirror of
https://github.com/discourse/discourse.git
synced 2025-06-03 19:39:30 +08:00
FEATURE: Admins can flag posts so they can review them later. (#12311)
Staff can send a post to the review queue by clicking the "Flag Post" button next to "Take Action...". Clicking it flags the post using the "Notify moderators" score type and hides it. A custom message will be sent to the user.
This commit is contained in:
@ -522,7 +522,7 @@ class Post < ActiveRecord::Base
|
||||
(topic.present? && (topic.private_message? || topic.category&.read_restricted))
|
||||
end
|
||||
|
||||
def hide!(post_action_type_id, reason = nil)
|
||||
def hide!(post_action_type_id, reason = nil, custom_message: nil)
|
||||
return if hidden?
|
||||
|
||||
reason ||= hidden_at ?
|
||||
@ -554,11 +554,16 @@ class Post < ActiveRecord::Base
|
||||
)
|
||||
}
|
||||
|
||||
message = custom_message
|
||||
if message.nil?
|
||||
message = hiding_again ? :post_hidden_again : :post_hidden
|
||||
end
|
||||
|
||||
Jobs.enqueue_in(
|
||||
5.seconds,
|
||||
:send_system_message,
|
||||
user_id: user.id,
|
||||
message_type: hiding_again ? :post_hidden_again : :post_hidden,
|
||||
message_type: message,
|
||||
message_options: options
|
||||
)
|
||||
end
|
||||
|
Reference in New Issue
Block a user