mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-12-01 03:17:53 -05:00
16 lines
333 B
Ruby
16 lines
333 B
Ruby
|
module Jobs
|
||
|
class CloseTopic < Jobs::Base
|
||
|
|
||
|
def execute(args)
|
||
|
topic = Topic.find(args[:topic_id])
|
||
|
if topic.auto_close_at
|
||
|
closer = User.find(args[:user_id])
|
||
|
if Guardian.new(closer).can_moderate?(topic)
|
||
|
topic.update_status('autoclosed', true, closer)
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
|
||
|
end
|
||
|
end
|