FEATURE: new setting to create a linked topic on autoclosing mega topics (#11001)

This commit adds a site setting `auto_close_topics_create_linked_topic`
which when enabled works in conjunction with `auto_close_topics_post_count`
setting and creates a new linked topic for the topic just closed.

The auto-created new topic contains a link for all the previous topics
and the topic titles are appended with `(Part {n})`.

The setting is enabled by default.
This commit is contained in:
Arpit Jalan
2020-11-02 12:18:48 +05:30
committed by GitHub
parent 3655062c60
commit 1476e17c35
9 changed files with 215 additions and 0 deletions

View File

@ -381,6 +381,11 @@ class PostCreator
locale: SiteSetting.default_locale
)
)
if SiteSetting.auto_close_topics_create_linked_topic?
# enqueue a job to create a linked topic
Jobs.enqueue_in(5.seconds, :create_linked_topic, post_id: @post.id)
end
end
end