2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-12 21:10:47 +08:00

Add a DiscourseEvent for when a topic is closed

This commit is contained in:
Robin Ward 2017-09-27 14:00:53 -04:00
parent 3e13becf33
commit 7578d8fc44
2 changed files with 18 additions and 0 deletions

View file

@ -36,6 +36,10 @@ TopicStatusUpdater = Struct.new(:topic, :user) do
result = false if rc == 0
end

if status.manually_closing_topic?
DiscourseEvent.trigger(:topic_closed, topic)
end

if @topic_status_update
if status.manually_closing_topic? || status.closing_topic?
topic.delete_topic_timer(TopicTimer.types[:close])