Skip to content

Commit dadc2a5

Browse files
committed
wake up topic on post creation
1 parent a669234 commit dadc2a5

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

plugin.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,14 @@ module ::CommunityCustomFields
4141
topic.custom_fields[:assignee_id] = 0
4242
topic.save_custom_fields
4343
end
44+
45+
on(:post_created) do |post, _opts, user|
46+
topic = post.topic
47+
48+
if (topic.custom_fields[:status] == "snoozed") && !user.admin
49+
topic.custom_fields[:status] = "open"
50+
topic.custom_fields[:snoozed_until] = nil
51+
topic.save_custom_fields
52+
end
53+
end
4454
end

0 commit comments

Comments
 (0)