Automatically close solved topics after N hours

My apologies if it was mentioned already
But it will be great if we could set autoclose after X hours for resolved topics.

6 Likes

I like this feature request and would love to add this option to the plugin. pr-welcome

5 Likes

@tgxworld given your recent changes, how simple would it be to add this to the solved plugin?

4 Likes

Pretty simple, just have to call topic.set_or_create_timer(TopicTimer.types[:close], SiteSetting.solved_topics_auto_close_hours) once the topic is marked as solved.

4 Likes

PR in

https://github.com/discourse/discourse-solved/pull/59

7 Likes

A few questions:

  • If a post is “un-selected” as the solution, will the timer be cancelled?
  • Similarly, once the topic is closed, the answer can still be “unselected” - should this make the topic re-open?
  • What if people continue replying to the topic after a solution has been chosen? Would it be better to replace “closing (n) hours after solution” with “closing (n) hours after last reply, if a solution has been chosen”?
6 Likes

I guess it should but it’ll be tricky to implement. We’ll have to track the context in which the timer was created in and cancel timers based on that context. I’ll have a look to see what the possibility is like but I think having the admin cancel the topic timer manually should be sufficient for the first pass.

I don’t think it should auto reopen if the answer is un-selected. In fact, I think it is a bug that the answer can be unselected when the topic is already closed.

Ah yes that is a good point, I’ve updated the PR to reflect that. Thank you :thumbsup:

6 Likes

Sorry, I realise now I wasn’t particularly clear. I was referring to the actual functionality rather than the copy. From looking at the code it seems like it’ll close the topic, even if people are still replying to it.

1 Like

You were very clear actually :slight_smile:

I think you missed

while reading through the code. That was how the feature should have been from the start :thumbsup:

4 Likes

Ah yes, will read more closely next time :see_no_evil:

2 Likes

OMG … THANK YOU team for this feature !

Ps: spanish translation updated (PR60)

4 Likes

This topic was automatically closed after 35 hours. New replies are no longer allowed.