mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: when a post is deleted because a moderator agreed with flags, send a message to the post author
This commit is contained in:
@@ -196,6 +196,15 @@ class PostDestroyer
|
||||
end
|
||||
|
||||
def agree_with_flags
|
||||
if @post.is_flagged?
|
||||
Jobs.enqueue(
|
||||
:send_system_message,
|
||||
user_id: @post.user.id,
|
||||
message_type: :flags_agreed_and_post_deleted,
|
||||
message_options: { url: @post.url }
|
||||
)
|
||||
end
|
||||
|
||||
PostAction.agree_flags!(@post, @user, delete_post: true)
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user