mirror of
https://github.com/discourse/discourse.git
synced 2025-09-05 08:59:27 +08:00
FEATURE: Allow admin to auto reopen at topic.
* This commit also introduces a `TopicStatusUpdate` model to support other forms of deferred topic status update in the future.
This commit is contained in:
parent
12e02873fc
commit
34b7bee568
52 changed files with 1442 additions and 955 deletions
|
@ -390,8 +390,16 @@ class PostCreator
|
|||
end
|
||||
|
||||
def update_topic_auto_close
|
||||
if @topic.auto_close_based_on_last_post && @topic.auto_close_hours
|
||||
@topic.set_auto_close(@topic.auto_close_hours).save
|
||||
topic_status_update = @topic.topic_status_update
|
||||
|
||||
if topic_status_update &&
|
||||
topic_status_update.based_on_last_post &&
|
||||
topic_status_update.duration > 0
|
||||
|
||||
@topic.set_or_create_status_update(TopicStatusUpdate.types[:close],
|
||||
topic_status_update.duration,
|
||||
based_on_last_post: topic_status_update.based_on_last_post
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue