mirror of
https://github.com/discourse/discourse.git
synced 2026-08-04 10:39:43 +08:00
Previously managing topic timers was staff + TL4 only. This moves the logic to a group site setting so that other groups can set timers.
15 lines
437 B
Ruby
Vendored
15 lines
437 B
Ruby
Vendored
# frozen_string_literal: true
|
|
|
|
module Jobs
|
|
class BumpTopic < ::Jobs::TopicTimerBase
|
|
def execute_timer_action(topic_timer, topic)
|
|
guardian = Guardian.new(topic_timer.user)
|
|
|
|
if guardian.can_create_post_on_topic?(topic) || guardian.can_set_topic_timer?(topic)
|
|
topic.add_small_action(Discourse.system_user, "autobumped", nil, bump: true)
|
|
end
|
|
|
|
topic_timer.trash!(Discourse.system_user)
|
|
end
|
|
end
|
|
end
|