mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: auto-delete any hidden posts that stay hidden for more than 30 days
This commit is contained in:
@@ -404,7 +404,7 @@ class PostAction < ActiveRecord::Base
|
||||
reason = guess_hide_reason(old_flags)
|
||||
end
|
||||
|
||||
Post.where(id: post.id).update_all(["hidden = true, hidden_at = CURRENT_TIMESTAMP, hidden_reason_id = COALESCE(hidden_reason_id, ?)", reason])
|
||||
Post.where(id: post.id).update_all(["hidden = true, hidden_at = ?, hidden_reason_id = COALESCE(hidden_reason_id, ?)", Time.now, reason])
|
||||
Topic.where("id = :topic_id AND NOT EXISTS(SELECT 1 FROM POSTS WHERE topic_id = :topic_id AND NOT hidden)", topic_id: post.topic_id).update_all(visible: false)
|
||||
|
||||
# inform user
|
||||
|
||||
Reference in New Issue
Block a user